🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Printing model summary of python models built using Python Learner .

User: "Rahul_M"
New Altair Community Member
Updated by Jocelyn
Hi All, I have stored models which were built using Custom Python Learner in RapidMiner ? Is there any way to print the model information using these stored objects (.ioo) alone? I tried passing the Python model object as input to Execute Python and Python Transformer, but it failed to accept the input. 
Sort by:
1 - 1 of 11
    User: "RolandJones"
    Altair Employee
    Accepted Answer
    Hi @Rahul_M,

    I've attached a small example, showing how you can use Execute Python to print the parameters to the log panel. The only challenge you may face is the exact code required will vary depending on the model type. I'd trained a simple sklearn model which I've also attached.

    Hope this helps,

    Best,

    Roland

    <?xml version="1.0" encoding="UTF-8"?><process version="10.3.001">
    
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="10.3.001" expanded="true" name="Process">
    <parameter key="logverbosity" value="init"/>
    <parameter key="random_seed" value="2001"/>
    <parameter key="send_mail" value="never"/>
    <parameter key="notification_email" value=""/>
    <parameter key="process_duration_for_mail" value="30"/>
    <parameter key="encoding" value="SYSTEM"/>
    <process expanded="true">
    <operator activated="true" class="retrieve" compatibility="10.3.001" expanded="true" height="68" name="Retrieve python-model" width="90" x="45" y="34">
    <parameter key="repository_entry" value="//Local Repository/python-model"/>
    </operator>
    <operator activated="true" class="python_scripting:execute_python" compatibility="10.0.001" expanded="true" height="103" name="Execute Python" width="90" x="179" y="34">
    <parameter key="script" value="import pandas&#10;&#10;def rm_main(model):&#10; print(model.get_params())"/>
    <parameter key="notebook_cell_tag_filter" value=""/>
    <parameter key="use_default_python" value="true"/>
    <parameter key="package_manager" value="conda (anaconda)"/>
    <parameter key="use_macros" value="false"/>
    </operator>
    <connect from_op="Retrieve python-model" from_port="output" to_op="Execute Python" to_port="input 1"/>
    <connect from_op="Execute Python" from_port="output 1" 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>