Problem with loop modelling output saving
sebastian_gonza
RapidMiner Certified Analyst, MemberPosts:52Guru
Hi
I have a Data set with Client ID | Order ID | Quantity | Price, what I want to do is a regression per client ID like Quantity = Beta + alpha*Price and save the output in a collection, I got to the collection but it keeps printing the same value over and over again, also I would like to append the Client ID to their respective model but I dont know how, could someone help me please?
Thanks
Attached: Sample data and process
< context>
< = " t运营商激活rue" class="process" compatibility="9.0.002" expanded="true" name="Process">
< = " t运营商激活rue" class="retrieve" compatibility="9.0.002" expanded="true" height="68" name="Retrieve pedidos_con_cliente_importe" width="90" x="45" y="340">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (5)" width="90" x="179" y="340">
< = " t运营商激活rue" class="set_role" compatibility="9.0.002" expanded="true" height="82" name="Set Role" width="90" x="313" y="340">
< = " t运营商激活rue" class="remove_duplicates" compatibility="9.0.002" expanded="true" height="103" name="Remove Duplicates" width="90" x="447" y="340">
< = " t运营商激活rue" class="concurrency:loop_values" compatibility="9.0.002" expanded="true" height="82" name="Loop Values" width="90" x="581" y="340">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (6)" width="90" x="112" y="34">
< = " t运营商激活rue" class="linear_regression" compatibility="9.0.002" expanded="true" height="103" name="Linear Regression" width="90" x="246" y="34">
< connect from_port="input 1" to_op="Select Attributes (6)" to_port="example set input"/>
< connect from_op="Select Attributes (6)" from_port="example set output" to_op="Linear Regression" to_port="training set"/>
< connect from_op="Linear Regression" from_port="model" to_port="output 1"/>
< = " t运营商激活rue" class="collect" compatibility="9.0.002" expanded="true" height="82" name="Collect" width="90" x="715" y="340"/>
< connect from_op="Retrieve pedidos_con_cliente_importe" from_port="output" to_op="Select Attributes (5)" to_port="example set input"/>
< connect from_op="Select Attributes (5)" from_port="example set output" to_op="Set Role" to_port="example set input"/>
< connect from_op="Set Role" from_port="example set output" to_op="Remove Duplicates" to_port="example set input"/>
< connect from_op="Remove Duplicates" from_port="example set output" to_op="Loop Values" to_port="input 1"/>
< connect from_op="Loop Values" from_port="output 1" to_op="Collect" to_port="input 1"/>
< connect from_op="Collect" from_port="collection" to_port="result 1"/>
Tagged:
0
Best Answers
-
MartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University ProfessorPosts:3,362RM Data Scientist
Hi,
attached is a solution. You need Operator Toolbox extension to run this.
Best,
Martin
< context>
< = " t运营商激活rue" class="process" compatibility="9.0.002" expanded="true" name="Process">
< = " t运营商激活rue" class="retrieve" compatibility="9.0.002" expanded="true" height="68" name="Retrieve pedidos_con_cliente_importe" width="90" x="45" y="340">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (5)" width="90" x="179" y="340">
< = " t运营商激活rue" class="set_role" compatibility="9.0.002" expanded="true" height="82" name="Set Role" width="90" x="313" y="340">
< = " t运营商激活rue" class="remove_duplicates" compatibility="9.0.002" expanded="true" height="103" name="Remove Duplicates" width="90" x="447" y="340">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (6)" width="90" x="581" y="136">
< = " t运营商激活rue" class="linear_regression" compatibility="9.0.002" expanded="true" height="103" name="Linear Regression" width="90" x="715" y="136">
< connect from_op="Select Attributes (6)" from_port="example set output" to_op="Linear Regression" to_port="training set"/>
< = " t运营商激活rue" class="collect" compatibility="9.0.002" expanded="true" height="82" name="Collect" width="90" x="983" y="340"/>
< = " t运营商激活rue" class="operator_toolbox:group_into_collection" compatibility="1.5.000-SNAPSHOT" expanded="true" height="82" name="Group Into Collection" width="90" x="581" y="340">
< = " t运营商激活rue" class="loop_collection" compatibility="9.0.002" expanded="true" height="82" name="Loop Collection" width="90" x="782" y="340">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (2)" width="90" x="179" y="85">
< = " t运营商激活rue" class="linear_regression" compatibility="9.0.002" expanded="true" height="103" name="Linear Regression (2)" width="90" x="313" y="85">
< connect from_port="single" to_op="Select Attributes (2)" to_port="example set input"/>
< connect from_op="Select Attributes (2)" from_port="example set output" to_op="Linear Regression (2)" to_port="training set"/>
< connect from_op="Linear Regression (2)" from_port="model" to_port="output 1"/>
< connect from_op="Retrieve pedidos_con_cliente_importe" from_port="output" to_op="Select Attributes (5)" to_port="example set input"/>
< connect from_op="Select Attributes (5)" from_port="example set output" to_op="Set Role" to_port="example set input"/>
< connect from_op="Set Role" from_port="example set output" to_op="Remove Duplicates" to_port="example set input"/>
< connect from_op="Remove Duplicates" from_port="example set output" to_op="Collect" to_port="input 1"/>
< connect from_op="Collect" from_port="collection" to_port="result 1"/>- Head of Data Science Services at RapidMiner -
Dortmund, Germany2 -
MartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University ProfessorPosts:3,362RM Data Scientist
did you use macros? Attached a version with annotate.
Cheers,
Martin
< context>
< = " t运营商激活rue" class="process" compatibility="9.0.002" expanded="true" name="Process">
< = " t运营商激活rue" class="retrieve" compatibility="9.0.002" expanded="true" height="68" name="Retrieve pedidos_con_cliente_importe" width="90" x="45" y="340">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (5)" width="90" x="179" y="340">
< = " t运营商激活rue" class="set_role" compatibility="9.0.002" expanded="true" height="82" name="Set Role" width="90" x="313" y="340">
< = " t运营商激活rue" class="remove_duplicates" compatibility="9.0.002" expanded="true" height="103" name="Remove Duplicates" width="90" x="447" y="340">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (6)" width="90" x="581" y="136">
< = " t运营商激活rue" class="linear_regression" compatibility="9.0.002" expanded="true" height="103" name="Linear Regression" width="90" x="715" y="136">
< connect from_op="Select Attributes (6)" from_port="example set output" to_op="Linear Regression" to_port="training set"/>
< = " t运营商激活rue" class="collect" compatibility="9.0.002" expanded="true" height="82" name="Collect" width="90" x="983" y="340"/>
< = " t运营商激活rue" class="operator_toolbox:group_into_collection" compatibility="1.5.000-SNAPSHOT" expanded="true" height="82" name="Group Into Collection" width="90" x="581" y="340">
< = " t运营商激活rue" class="loop_collection" compatibility="9.0.002" expanded="true" height="82" name="Loop Collection" width="90" x="782" y="340">
< = " t运营商激活rue" class="extract_macro" compatibility="9.0.002" expanded="true" height="68" name="Extract Macro" width="90" x="45" y="34">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (2)" width="90" x="179" y="85">
< = " t运营商激活rue" class="linear_regression" compatibility="9.0.002" expanded="true" height="103" name="Linear Regression (2)" width="90" x="313" y="85">
< = " t运营商激活rue" class="annotate" compatibility="9.0.002" expanded="true" height="68" name="Annotate" width="90" x="514" y="85">
<参数键= "评论" value = " % {IdCliente} " / >
< connect from_port="single" to_op="Extract Macro" to_port="example set"/>
< connect from_op="Extract Macro" from_port="example set" to_op="Select Attributes (2)" to_port="example set input"/>
< connect from_op="Select Attributes (2)" from_port="example set output" to_op="Linear Regression (2)" to_port="training set"/>
< connect from_op="Linear Regression (2)" from_port="model" to_op="Annotate" to_port="input"/>
< connect from_op="Annotate" from_port="output" to_port="output 1"/>
< connect from_op="Retrieve pedidos_con_cliente_importe" from_port="output" to_op="Select Attributes (5)" to_port="example set input"/>
< connect from_op="Select Attributes (5)" from_port="example set output" to_op="Set Role" to_port="example set input"/>
< connect from_op="Set Role" from_port="example set output" to_op="Remove Duplicates" to_port="example set input"/>
< connect from_op="Remove Duplicates" from_port="example set output" to_op="Collect" to_port="input 1"/>
< connect from_op="Collect" from_port="collection" to_port="result 1"/>- Head of Data Science Services at RapidMiner -
Dortmund, Germany1
Answers
Sample Data
Hi@sebastian_gonza,
Can you check your XML file : It seems to be broken (it can not be loaded in RapidMiner)
Regards,
Lionel
< context>
< = " t运营商激活rue" class="process" compatibility="9.0.002" expanded="true" name="Process">
< = " t运营商激活rue" class="retrieve" compatibility="9.0.002" expanded="true" height="68" name="Retrieve pedidos_con_cliente_importe" width="90" x="45" y="340">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (5)" width="90" x="179" y="340">
< = " t运营商激活rue" class="set_role" compatibility="9.0.002" expanded="true" height="82" name="Set Role" width="90" x="313" y="340">
< = " t运营商激活rue" class="remove_duplicates" compatibility="9.0.002" expanded="true" height="103" name="Remove Duplicates" width="90" x="447" y="340">
< = " t运营商激活rue" class="concurrency:loop_values" compatibility="9.0.002" expanded="true" height="82" name="Loop Values" width="90" x="581" y="340">
< = " t运营商激活rue" class="select_attributes" compatibility="9.0.002" expanded="true" height="82" name="Select Attributes (6)" width="90" x="112" y="34">
< = " t运营商激活rue" class="linear_regression" compatibility="9.0.002" expanded="true" height="103" name="Linear Regression" width="90" x="246" y="34">
< connect from_port="input 1" to_op="Select Attributes (6)" to_port="example set input"/>
< connect from_op="Select Attributes (6)" from_port="example set output" to_op="Linear Regression" to_port="training set"/>
< connect from_op="Linear Regression" from_port="model" to_port="output 1"/>
< = " t运营商激活rue" class="collect" compatibility="9.0.002" expanded="true" height="82" name="Collect" width="90" x="715" y="340"/>
< connect from_op="Retrieve pedidos_con_cliente_importe" from_port="output" to_op="Select Attributes (5)" to_port="example set input"/>
< connect from_op="Select Attributes (5)" from_port="example set output" to_op="Set Role" to_port="example set input"/>
< connect from_op="Set Role" from_port="example set output" to_op="Remove Duplicates" to_port="example set input"/>
< connect from_op="Remove Duplicates" from_port="example set output" to_op="Loop Values" to_port="input 1"/>
< connect from_op="Loop Values" from_port="output 1" to_op="Collect" to_port="input 1"/>
< connect from_op="Collect" from_port="collection" to_port="result 1"/>
Thank you Martin
Sorry one last thing, I tried using "Append" operator to join all the model results in a table but it only allows a table to be joined, also I cant append the IDclient to each model, could you help me please?
Thank you
Hi,
i think Annotate is the way to go here.
BR,
Martin
Dortmund, Germany
Sorry, I could not ad the IdCliente to each model with annotate, I set the parameters
Annotation name = Comment
Annotation value = IdCliente
But no specific model has the IdClient append to the IOObject
Should it be another annotation name?