Optimizing Set Macro on 7.5

JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:578Unicorn
edited December 2018 inHelp

Is anyone else finding problems optimizing Set Macro in version 7.5 of RapidMiner?

试图优化一个python模型&发现那t the value parametrer of Set Macro doesn't appear in Optimize Evolutionary.























































<操作符= " true " class = " python_scripting激活:execute_python" compatibility="7.4.000" expanded="true" height="82" name="BDT (sklearn)" width="90" x="112" y="34">









<操作符= " true " class = " python_scripting激活:execute_python" compatibility="7.4.000" expanded="true" height="103" name="Apply Model (2)" width="90" x="112" y="34">
<参数键=“脚本”值= "熊猫作为pd导入 # rm_main is a mandatory function, # the number of arguments has to be the number of input ports (can be none) def rm_main(rfinfo, data): rf = rfinfo[0] regular = rfinfo[1] label = rfinfo[2] meta = data.rm_metadata predictions = rf.predict(data[regular]) confidences = rf.predict_proba(data[regular]) predictions = pd.DataFrame(predictions, columns=["prediction("+label+")"]) confidences = pd.DataFrame(confidences, columns=["confidence(" + str(c) + ")" for c in rf.classes_]) data = data.join(predictions) data = data.join(confidences) data.rm_metadata = meta data.rm_metadata["prediction("+label+")"] = ("nominal","prediction") for c in rf.classes_: data.rm_metadata["confidence("+str(c)+")"] = ("numerical","confidence_"+str(c)) return data, rf"/>















Python

































Tagged:

Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:1,761Unicorn

    I think this isn't a bug because the Evolutionary optimzer uses the genetic parameters to 'randomly' assign values, so you can't take a Grid approach this. Did you try this in a regular Grid optmizer?

  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:578Unicorn

    If not a bug then it's a missing feature. I've managed to create a workaround which works, but is clearly not the most efficient. Let's move this thread into feature requests.

    Edit: realise my process didn't display properly.

    As you can see, the workaround uses RM modelling operators to represent the values that I want to change in the Python code. So the feature I'd like is an operator which Optimize Parameters Evolutionary can access allowing values to be set and used by macros.































































    Extracts the parameters to macro values



























    <操作符= " true " class = " python_scripting激活:execute_python" compatibility="7.4.000" expanded="true" height="82" name="Random Forest" width="90" x="112" y="34">









    <操作符= " true " class = " python_scripting激活:execute_python" compatibility="7.4.000" expanded="true" height="103" name="Apply Model (2)" width="90" x="112" y="34">
    <参数键=“脚本”值= "熊猫作为pd导入 # rm_main is a mandatory function, # the number of arguments has to be the number of input ports (can be none) def rm_main(rfinfo, data): rf = rfinfo[0] regular = rfinfo[1] label = rfinfo[2] meta = data.rm_metadata predictions = rf.predict(data[regular]) confidences = rf.predict_proba(data[regular]) predictions = pd.DataFrame(predictions, columns=["prediction("+label+")"]) confidences = pd.DataFrame(confidences, columns=["confidence(" + str(c) + ")" for c in rf.classes_]) data = data.join(predictions) data = data.join(confidences) data.rm_metadata = meta data.rm_metadata["prediction("+label+")"] = ("nominal","prediction") for c in rf.classes_: data.rm_metadata["confidence("+str(c)+")"] = ("numerical","confidence_"+str(c)) return data, rf"/>















    Python



    <操作符= " true " class = " provide_macro_as激活_log_value" compatibility="7.5.001" expanded="true" height="82" name="LognTree" width="90" x="45" y="34">


    <操作符= " true " class = " provide_macro_as激活_log_value" compatibility="7.5.001" expanded="true" height="82" name="Log maxDepth" width="90" x="179" y="34">


    <操作符= " true " class = " provide_macro_as激活_log_value" compatibility="7.5.001" expanded="true" height="82" name="Log minLeafSize" width="90" x="313" y="34">


    <操作符= " true " class = " provide_macro_as激活_log_value" compatibility="7.5.001" expanded="true" height="82" name="Log minSizeSplit" width="90" x="447" y="34">
















































    yyhuang
Sign InorRegisterto comment.