Options

How to provide a dinaymic dataset to Apply Model

jseekerjseeker Member Posts: 12 Contributor II
edited November 2018 in Help
Dear community members,
I got a problem with rapid miner.
Let me describe my issue.
I have been building a process that includes two main components:  decision Tree and a Apply Model.
I have this process schema

image

My problem is how to provide a dynamic retrieve to Apply model.
I wish to performe a service with rapidanalytics, which accepts in input those five data (STG, SCG, STR, LPR, PEG)
My model will predict the user learning level.
Now i'm providing a static dataset like this

image


Anyone have any idea how to do?

Thank you so much in advance.

bye

Answers

  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,995 RM Engineering
    Hi,

    you can do that via macros. You then need to have all data sets in a given subfolder of your process and reference the data in your "Retrieve" operator like this:

    /subfolder/%{dataset}
    Now you can set the macro 'dataset' from your service and when for example the service sets it to 'STG', your process will retrieve the /subfolder/STG dataset and use it.

    Regards,
    Marco
  • Options
    jseekerjseeker Member Posts: 12 Contributor II
    Hi Marco,
    thank you for your answer. I thought about macros. I'm going to put values typed by user. You suggest to create differents dataset that could i provide to my process? I'm thinking this solution is useful if you want to divide the main dataset into sub dataset.
    Now I provide those values for run an example.
    Let me clarify my idea.
    The process at the end will show to user a form with five textbox (STG, SCG, STR, LPR, PEG) which you can fill with decimal values. After running you can view the prediction about user learning level, for example : hight, low, very low etc etc.
    Waiting for your answer.
    Thank you.

    Regard
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,995 RM Engineering
    Hi,

    now I get what you're trying to do :)
    You could use the "Generate Data" operator with macros for that, see below. It will generate exactly one example which can be populated by filling macros with user supplied values.

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="6.0.007">
     <context>
       <input/>
       <output/>
       <macros/>
     </context>
     <operator activated="true" class="process" compatibility="6.0.007" expanded="true" name="Process">
       <process expanded="true">
         <operator activated="true" class="generate_data_user_specification" compatibility="6.0.007" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="45" y="30">
           <list key="attribute_values">
             <parameter key="STG" value="%{STG}"/>
             <parameter key="SCG" value="%{SCG}"/>
             <parameter key="STR" value="%{STR}"/>
             <parameter key="LDR" value="%{LDR}"/>
             <parameter key="PEG" value="%{PEG}"/>
             <parameter key="label" value="NaN"/>
           </list>
           <list key="set_additional_roles"/>
         </operator>
         <connect from_op="Generate Data by User Specification" from_port="output" to_port="result 1"/>
         <portSpacing port="source_input 1" spacing="0"/>
         <portSpacing port="sink_result 1" spacing="0"/>
         <portSpacing port="sink_result 2" spacing="0"/>
       </process>
     </operator>
    </process>
    Regards,
    Marco
  • Options
    jseekerjseeker Member Posts: 12 Contributor II
    Hi,
    thank you for your patience.
    I tryed to use the generate data operator but i don't understand where i can insert your xml.
    Coul you answer me how to use this operator?
    Thank you.

    Regards, jseeker
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,995 RM Engineering
    Hi,

    if you're having the latest Studio version, you can simply copy&paste the XML directly into the process view (just click into the process view and then press ctrl+v).
    About the Generate Data operator in general: You can specify the attribute names and their value with the first "attribute values" parameter. You set the name of the attribute(s) in the left column and their respective value(s) in the right column. You can use macros and function expressions there. So what I did for your case was to create a row of macro values.

    Regards,
    Marco
  • Options
    jseekerjseeker Member Posts: 12 Contributor II
    Hi,
    Dear Marco or anyone you are, i need your help still.
    About the general Data operator, i understand how i can set it.
    I pasted the suggested xml. When i try to export the process as a service (rapid analytics) and click run "test", i get this error : "Error executing process /home/user/processes/GenerateDataTest for service GenerateDataTest: Generation exception: 'No such attribute: 'STG"
    I think this happen because the first attribute STG have not a value.
    I would like my general data operator retrieves attribute's value by the macro. But i didn't understand how a macro works.

    Thank you.

    Regards, jsee.
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,995 RM Engineering
    Hi,

    Macros are referenced in operator parameters by %{macro_name}. If your macro is called "hello" and set to the value "world", "%{hello}" would evaluate to "world" at runtime.
    I don't understand the other part of your message, this is what the process I posted earlier contains when clicking on the "attribute values" parameter button:

    image

    Regards,
    Marco
  • Options
    jseekerjseeker Member Posts: 12 Contributor II
    Hi,
    i solved previus problem, thank you.
    I have this process
    image

    these attributes value

    image

    i get this error

    image

    I try to convert with different operators but i don't have any success

    Do you have an idea, how i can resolve this error?
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,995 RM Engineering
    Hi,

    Generate Data creates numerical attributes. If you want a nominal label, add a "Numerical to Polynominal" operator and select the single label attribute.

    Regards,
    Marco
  • Options
    jseekerjseeker Member Posts: 12 Contributor II
    Hi,
    i solved thank you.
    if i want to hide a column from my dataset, which is the right operator?
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,995 RM Engineering
    Hi,

    Select Attributes, select the attribute(s) you want to remove, and select "invert".

    Regards,
    Marco
  • Options
    jseekerjseeker Member Posts: 12 Contributor II
    Hi,
    i completed finally my service in rapid analytics, thank you so much for your support.
    I need other information about rapid analytics.
    I want to get the wsdl file of my service.
    I tryed with follow link : http://localhost:8080/RA/process/LearningDecisionTreeRecordTest?wsdl
    I get an error : server error 500
    Any suggestions ???

    Thank you

    jseeker
Sign In or Register to comment.