Options

How do I introduce random/new data into a Neural Net model?

FrancoisRFrancoisR Member Posts: 3 Newbie
I have built a (supervised training) Neural Net model to predict instances of Diabetes.  How do I introduce new patient data to the model to get predictions on these patients?

Best Answers

  • Options
    MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,511 RM Data Scientist
    Solution Accepted
    Hi,
    what you did was using a Feature Selection, whose task it is to give you the best possible columns to build a model on, by using a model. You would need to use another ANN on this and then the Apply Model operator to score unknown data.

    Have you seen the academy? academy.rapidminer.com should help you a lot.

    Best,
    Martin
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • Options
    CKönigCKönig Administrator, Moderator, Employee, Member Posts: 70 RM Team Member
    edited October 2023 Solution Accepted
    Hello @FrancoisR,

    in this case, you would need to rebuild the model on the whole dataset (old and new combined) to create a better model. This is the usual way to handle new data. This also helps you to discard possibly outdated information from your training dataset, depending on your actual use case.

    However, if the algorithm for creating a machine learning model supports it, we do have the option to update pre-trained models with new data. This capability can be checked in the Operator Information:


    An example for an updatable model would be a Naive Bayes model. Updating an existing model trained somewhen earlier can be done by the Update Model (surprise!) operator:



    See this example process (copy the whole xml code, click in the background of an empty process and press "Ctrl+V" to paste it there):

    <div><?xml version="1.0" encoding="UTF-8"?><process version="10.2.000"></div><div>&nbsp; <context></div><div>&nbsp; &nbsp; <input/></div><div>&nbsp; &nbsp; <output/></div><div>&nbsp; &nbsp; <macros/></div><div>&nbsp; </context></div><div>&nbsp; <operator activated="true" class="process" compatibility="10.2.000" expanded="true" name="Process"></div><div>&nbsp; &nbsp; <parameter key="logverbosity" value="init"/></div><div>&nbsp; &nbsp; <parameter key="random_seed" value="2001"/></div><div>&nbsp; &nbsp; <parameter key="send_mail" value="never"/></div><div>&nbsp; &nbsp; <parameter key="notification_email" value=""/></div><div>&nbsp; &nbsp; <parameter key="process_duration_for_mail" value="30"/></div><div>&nbsp; &nbsp; <parameter key="encoding" value="SYSTEM"/></div><div>&nbsp; &nbsp; <process expanded="true"></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="retrieve" compatibility="10.2.000" expanded="true" height="68" name="Retrieve Deals" width="90" x="45" y="391"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="repository_entry" value="//Samples/data/Deals"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <description align="center" color="transparent" colored="false" width="126">Old data</description></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="naive_bayes" compatibility="10.2.000" expanded="true" height="82" name="Naive Bayes" width="90" x="179" y="391"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="laplace_correction" value="true"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <description align="center" color="transparent" colored="false" width="126">create a model based on &amp;quot;old data&amp;quot;</description></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="retrieve" compatibility="10.2.000" expanded="true" height="68" name="Retrieve Deals-Testset" width="90" x="179" y="187"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="repository_entry" value="//Samples/data/Deals-Testset"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <description align="center" color="transparent" colored="false" width="126">New data</description></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="multiply" compatibility="10.2.000" expanded="true" height="103" name="Multiply" width="90" x="313" y="187"/></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="apply_model" compatibility="10.2.000" expanded="true" height="82" name="Apply Old Model" width="90" x="447" y="391"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <list key="application_parameters"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <description align="center" color="transparent" colored="false" width="126">apply old model on new, unseen data</description></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="performance_classification" compatibility="10.2.000" expanded="true" height="82" name="Performance Old" width="90" x="849" y="391"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="main_criterion" value="first"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="accuracy" value="true"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="classification_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="kappa" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="weighted_mean_recall" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="weighted_mean_precision" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="spearman_rho" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="kendall_tau" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="absolute_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="relative_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="relative_error_lenient" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="relative_error_strict" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="normalized_absolute_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="root_mean_squared_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="root_relative_squared_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="squared_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="correlation" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="squared_correlation" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="cross-entropy" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="margin" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="soft_margin_loss" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="logistic_loss" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="skip_undefined_labels" value="true"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="use_example_weights" value="true"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <list key="class_weights"/></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="update_model" compatibility="10.2.000" expanded="true" height="82" name="Update Model" width="90" x="581" y="187"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <description align="center" color="transparent" colored="false" width="126">update the model with new data</description></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="apply_model" compatibility="10.2.000" expanded="true" height="82" name="Apply New Model" width="90" x="715" y="187"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <list key="application_parameters"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <description align="center" color="transparent" colored="false" width="126">apply the updated model on the new data</description></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <operator activated="true" class="performance_classification" compatibility="10.2.000" expanded="true" height="82" name="Performance New" width="90" x="849" y="187"></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="main_criterion" value="first"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="accuracy" value="true"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="classification_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="kappa" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="weighted_mean_recall" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="weighted_mean_precision" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="spearman_rho" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="kendall_tau" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="absolute_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="relative_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="relative_error_lenient" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="relative_error_strict" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="normalized_absolute_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="root_mean_squared_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="root_relative_squared_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="squared_error" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="correlation" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="squared_correlation" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="cross-entropy" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="margin" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="soft_margin_loss" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="logistic_loss" value="false"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="skip_undefined_labels" value="true"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <parameter key="use_example_weights" value="true"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <list key="class_weights"/></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <description align="center" color="transparent" colored="false" width="126">Increased performance on new dataset</description></div><div>&nbsp; &nbsp; &nbsp; </operator></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Retrieve Deals" from_port="output" to_op="Naive Bayes" to_port="training set"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Naive Bayes" from_port="model" to_op="Apply Old Model" to_port="model"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Retrieve Deals-Testset" from_port="output" to_op="Multiply" to_port="input"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Multiply" from_port="output 1" to_op="Update Model" to_port="example set"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Multiply" from_port="output 2" to_op="Apply Old Model" to_port="unlabelled data"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Apply Old Model" from_port="labelled data" to_op="Performance Old" to_port="labelled data"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Apply Old Model" from_port="model" to_op="Update Model" to_port="model"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Update Model" from_port="example set" to_op="Apply New Model" to_port="unlabelled data"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Update Model" from_port="model" to_op="Apply New Model" to_port="model"/></div><div>&nbsp; &nbsp; &nbsp; <connect from_op="Apply New Model" from_port="labelled data" to_op="Performance New" to_port="labelled data"/></div><div>&nbsp; &nbsp; &nbsp; <portSpacing port="source_input 1" spacing="0"/></div><div>&nbsp; &nbsp; &nbsp; <portSpacing port="sink_result 1" spacing="0"/></div><div>&nbsp; &nbsp; </process></div><div>&nbsp; </operator></div><div></process></div><div></div>
    Kind regards,
    Christian

Answers

  • Options
    FrancoisRFrancoisR Member Posts: 3 Newbie
    Excellent, thank you very much
  • Options
    FrancoisRFrancoisR Member Posts: 3 Newbie
    Hi Christian, this is excellent feedback. Thank you very much for assisting me!  Kind regards
Sign In or Register to comment.