I want to know the accuracy of data testing and training with the method of optimize generate (GGA)

s_na99
s_na99 New Altair Community Member
edited November 2024 in Community Q&A
I want to know the accuracy of data testing and training with the method of optimize generate (GGA), how do I do that? thank you

Answers

  • lionelderkrikor
    lionelderkrikor New Altair Community Member
    Hi @s_na99,

    Here a process which performs what you want to do : 

    I put an Apply Model and a Performance operators in the training part of the Cross validation operator (to have the training error) : 



    BTW do you know that oyu can use the new Automatic Feature Engineering operator which performs automatically
    for you the Feaure selection and feature generation for you ?
    You can test it via submitting your data to AutoModel..or directly in RapidMiner  GUI...

    The process : 

    <?xml version="1.0" encoding="UTF-8"?><process version="9.5.000">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Root" origin="GENERATED_TUTORIAL">
        <parameter key="logverbosity" value="init"/>
        <parameter key="random_seed" value="1969"/>
        <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" breakpoints="after" class="retrieve" compatibility="9.5.000" expanded="true" height="68" name="Retrieve Sonar" width="90" x="112" y="136">
            <parameter key="repository_entry" value="//Samples/data/Sonar"/>
          </operator>
          <operator activated="true" class="concurrency:cross_validation" compatibility="9.5.000" expanded="true" height="166" name="Cross Validation" width="90" x="380" y="136">
            <parameter key="split_on_batch_attribute" value="false"/>
            <parameter key="leave_one_out" value="false"/>
            <parameter key="number_of_folds" value="3"/>
            <parameter key="sampling_type" value="automatic"/>
            <parameter key="use_local_random_seed" value="false"/>
            <parameter key="local_random_seed" value="1992"/>
            <parameter key="enable_parallel_execution" value="true"/>
            <process expanded="true">
              <operator activated="true" class="multiply" compatibility="9.5.000" expanded="true" height="103" name="Multiply" width="90" x="45" y="34"/>
              <operator activated="true" class="optimize_by_generation_gga" compatibility="9.5.000" expanded="true" height="103" name="Generate" width="90" x="179" y="136">
                <parameter key="max_number_of_new_attributes" value="1"/>
                <parameter key="limit_max_total_number_of_attributes" value="false"/>
                <parameter key="max_total_number_of_attributes" value="1"/>
                <parameter key="use_local_random_seed" value="false"/>
                <parameter key="local_random_seed" value="1992"/>
                <parameter key="maximal_fitness" value="Infinity"/>
                <parameter key="population_size" value="5"/>
                <parameter key="maximum_number_of_generations" value="30"/>
                <parameter key="use_plus" value="true"/>
                <parameter key="use_diff" value="false"/>
                <parameter key="use_mult" value="true"/>
                <parameter key="use_div" value="false"/>
                <parameter key="reciprocal_value" value="true"/>
                <parameter key="use_early_stopping" value="false"/>
                <parameter key="generations_without_improval" value="2"/>
                <parameter key="tournament_size" value="0.25"/>
                <parameter key="start_temperature" value="1.0"/>
                <parameter key="dynamic_selection_pressure" value="true"/>
                <parameter key="keep_best_individual" value="false"/>
                <parameter key="p_initialize" value="0.5"/>
                <parameter key="p_crossover" value="0.5"/>
                <parameter key="crossover_type" value="uniform"/>
                <parameter key="p_generate" value="0.1"/>
                <parameter key="use_heuristic_mutation_probability" value="true"/>
                <process expanded="true">
                  <operator activated="true" class="concurrency:cross_validation" compatibility="9.5.000" expanded="true" height="145" name="Cross Validation (2)" width="90" x="447" y="85">
                    <parameter key="split_on_batch_attribute" value="false"/>
                    <parameter key="leave_one_out" value="false"/>
                    <parameter key="number_of_folds" value="5"/>
                    <parameter key="sampling_type" value="automatic"/>
                    <parameter key="use_local_random_seed" value="false"/>
                    <parameter key="local_random_seed" value="1992"/>
                    <parameter key="enable_parallel_execution" value="true"/>
                    <process expanded="true">
                      <operator activated="true" class="k_nn" compatibility="9.5.000" expanded="true" height="82" name="k-NN" width="90" x="179" y="34">
                        <parameter key="k" value="5"/>
                        <parameter key="weighted_vote" value="true"/>
                        <parameter key="measure_types" value="MixedMeasures"/>
                        <parameter key="mixed_measure" value="MixedEuclideanDistance"/>
                        <parameter key="nominal_measure" value="NominalDistance"/>
                        <parameter key="numerical_measure" value="EuclideanDistance"/>
                        <parameter key="divergence" value="GeneralizedIDivergence"/>
                        <parameter key="kernel_type" value="radial"/>
                        <parameter key="kernel_gamma" value="1.0"/>
                        <parameter key="kernel_sigma1" value="1.0"/>
                        <parameter key="kernel_sigma2" value="0.0"/>
                        <parameter key="kernel_sigma3" value="2.0"/>
                        <parameter key="kernel_degree" value="3.0"/>
                        <parameter key="kernel_shift" value="1.0"/>
                        <parameter key="kernel_a" value="1.0"/>
                        <parameter key="kernel_b" value="0.0"/>
                      </operator>
                      <connect from_port="training set" to_op="k-NN" to_port="training set"/>
                      <connect from_op="k-NN" from_port="model" to_port="model"/>
                      <portSpacing port="source_training set" spacing="0"/>
                      <portSpacing port="sink_model" spacing="0"/>
                      <portSpacing port="sink_through 1" spacing="0"/>
                    </process>
                    <process expanded="true">
                      <operator activated="true" class="apply_model" compatibility="9.5.000" expanded="true" height="82" name="Apply Model" width="90" x="112" y="34">
                        <list key="application_parameters"/>
                        <parameter key="create_view" value="false"/>
                      </operator>
                      <operator activated="true" class="performance_classification" compatibility="9.5.000" expanded="true" height="82" name="Performance" width="90" x="246" y="34">
                        <parameter key="main_criterion" value="first"/>
                        <parameter key="accuracy" value="true"/>
                        <parameter key="classification_error" value="false"/>
                        <parameter key="kappa" value="false"/>
                        <parameter key="weighted_mean_recall" value="false"/>
                        <parameter key="weighted_mean_precision" value="false"/>
                        <parameter key="spearman_rho" value="false"/>
                        <parameter key="kendall_tau" value="false"/>
                        <parameter key="absolute_error" value="false"/>
                        <parameter key="relative_error" value="false"/>
                        <parameter key="relative_error_lenient" value="false"/>
                        <parameter key="relative_error_strict" value="false"/>
                        <parameter key="normalized_absolute_error" value="false"/>
                        <parameter key="root_mean_squared_error" value="false"/>
                        <parameter key="root_relative_squared_error" value="false"/>
                        <parameter key="squared_error" value="false"/>
                        <parameter key="correlation" value="false"/>
                        <parameter key="squared_correlation" value="false"/>
                        <parameter key="cross-entropy" value="false"/>
                        <parameter key="margin" value="false"/>
                        <parameter key="soft_margin_loss" value="false"/>
                        <parameter key="logistic_loss" value="false"/>
                        <parameter key="skip_undefined_labels" value="true"/>
                        <parameter key="use_example_weights" value="true"/>
                        <list key="class_weights"/>
                      </operator>
                      <connect from_port="model" to_op="Apply Model" to_port="model"/>
                      <connect from_port="test set" to_op="Apply Model" to_port="unlabelled data"/>
                      <connect from_op="Apply Model" from_port="labelled data" to_op="Performance" to_port="labelled data"/>
                      <connect from_op="Performance" from_port="performance" to_port="performance 1"/>
                      <portSpacing port="source_model" spacing="0"/>
                      <portSpacing port="source_test set" spacing="0"/>
                      <portSpacing port="source_through 1" spacing="0"/>
                      <portSpacing port="sink_test set results" spacing="0"/>
                      <portSpacing port="sink_performance 1" spacing="0"/>
                      <portSpacing port="sink_performance 2" spacing="0"/>
                    </process>
                  </operator>
                  <connect from_port="example set source" to_op="Cross Validation (2)" to_port="example set"/>
                  <connect from_op="Cross Validation (2)" from_port="performance 1" to_port="performance sink"/>
                  <portSpacing port="source_example set source" spacing="0"/>
                  <portSpacing port="sink_performance sink" spacing="0"/>
                </process>
              </operator>
              <operator activated="true" class="select_by_weights" compatibility="9.5.000" expanded="true" height="103" name="Select by Weights" width="90" x="313" y="34">
                <parameter key="weight_relation" value="greater equals"/>
                <parameter key="weight" value="1.0"/>
                <parameter key="k" value="10"/>
                <parameter key="p" value="0.5"/>
                <parameter key="deselect_unknown" value="true"/>
                <parameter key="use_absolute_weights" value="true"/>
              </operator>
              <operator activated="true" class="k_nn" compatibility="9.5.000" expanded="true" height="82" name="k-NN (2)" width="90" x="447" y="34">
                <parameter key="k" value="5"/>
                <parameter key="weighted_vote" value="true"/>
                <parameter key="measure_types" value="MixedMeasures"/>
                <parameter key="mixed_measure" value="MixedEuclideanDistance"/>
                <parameter key="nominal_measure" value="NominalDistance"/>
                <parameter key="numerical_measure" value="EuclideanDistance"/>
                <parameter key="divergence" value="GeneralizedIDivergence"/>
                <parameter key="kernel_type" value="radial"/>
                <parameter key="kernel_gamma" value="1.0"/>
                <parameter key="kernel_sigma1" value="1.0"/>
                <parameter key="kernel_sigma2" value="0.0"/>
                <parameter key="kernel_sigma3" value="2.0"/>
                <parameter key="kernel_degree" value="3.0"/>
                <parameter key="kernel_shift" value="1.0"/>
                <parameter key="kernel_a" value="1.0"/>
                <parameter key="kernel_b" value="0.0"/>
              </operator>
              <operator activated="true" class="multiply" compatibility="9.5.000" expanded="true" height="103" name="Multiply (2)" width="90" x="447" y="136"/>
              <operator activated="true" class="apply_model" compatibility="9.5.000" expanded="true" height="82" name="Apply Model (2)" width="90" x="581" y="136">
                <list key="application_parameters"/>
                <parameter key="create_view" value="false"/>
              </operator>
              <operator activated="true" class="performance_classification" compatibility="9.5.000" expanded="true" height="82" name="Training_performance" width="90" x="581" y="238">
                <parameter key="main_criterion" value="first"/>
                <parameter key="accuracy" value="true"/>
                <parameter key="classification_error" value="false"/>
                <parameter key="kappa" value="false"/>
                <parameter key="weighted_mean_recall" value="false"/>
                <parameter key="weighted_mean_precision" value="false"/>
                <parameter key="spearman_rho" value="false"/>
                <parameter key="kendall_tau" value="false"/>
                <parameter key="absolute_error" value="false"/>
                <parameter key="relative_error" value="false"/>
                <parameter key="relative_error_lenient" value="false"/>
                <parameter key="relative_error_strict" value="false"/>
                <parameter key="normalized_absolute_error" value="false"/>
                <parameter key="root_mean_squared_error" value="false"/>
                <parameter key="root_relative_squared_error" value="false"/>
                <parameter key="squared_error" value="false"/>
                <parameter key="correlation" value="false"/>
                <parameter key="squared_correlation" value="false"/>
                <parameter key="cross-entropy" value="false"/>
                <parameter key="margin" value="false"/>
                <parameter key="soft_margin_loss" value="false"/>
                <parameter key="logistic_loss" value="false"/>
                <parameter key="skip_undefined_labels" value="true"/>
                <parameter key="use_example_weights" value="true"/>
                <list key="class_weights"/>
              </operator>
              <connect from_port="training set" to_op="Multiply" to_port="input"/>
              <connect from_op="Multiply" from_port="output 1" to_op="Select by Weights" to_port="example set input"/>
              <connect from_op="Multiply" from_port="output 2" to_op="Generate" to_port="example set in"/>
              <connect from_op="Generate" from_port="attribute weights out" to_op="Select by Weights" to_port="weights"/>
              <connect from_op="Select by Weights" from_port="example set output" to_op="k-NN (2)" to_port="training set"/>
              <connect from_op="Select by Weights" from_port="weights" to_port="through 2"/>
              <connect from_op="k-NN (2)" from_port="model" to_op="Multiply (2)" to_port="input"/>
              <connect from_op="k-NN (2)" from_port="exampleSet" to_op="Apply Model (2)" to_port="unlabelled data"/>
              <connect from_op="Multiply (2)" from_port="output 1" to_op="Apply Model (2)" to_port="model"/>
              <connect from_op="Multiply (2)" from_port="output 2" to_port="model"/>
              <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Training_performance" to_port="labelled data"/>
              <connect from_op="Training_performance" from_port="performance" to_port="through 1"/>
              <portSpacing port="source_training set" spacing="0"/>
              <portSpacing port="sink_model" spacing="0"/>
              <portSpacing port="sink_through 1" spacing="0"/>
              <portSpacing port="sink_through 2" spacing="0"/>
              <portSpacing port="sink_through 3" spacing="0"/>
            </process>
            <process expanded="true">
              <operator activated="true" class="select_by_weights" compatibility="9.5.000" expanded="true" height="103" name="Select by Weights (2)" width="90" x="112" y="85">
                <parameter key="weight_relation" value="greater equals"/>
                <parameter key="weight" value="1.0"/>
                <parameter key="k" value="10"/>
                <parameter key="p" value="0.5"/>
                <parameter key="deselect_unknown" value="true"/>
                <parameter key="use_absolute_weights" value="true"/>
              </operator>
              <operator activated="true" class="apply_model" compatibility="9.5.000" expanded="true" height="82" name="Apply Model (3)" width="90" x="313" y="85">
                <list key="application_parameters"/>
                <parameter key="create_view" value="false"/>
              </operator>
              <operator activated="true" class="performance_classification" compatibility="9.5.000" expanded="true" height="82" name="Test_performance" width="90" x="313" y="187">
                <parameter key="main_criterion" value="first"/>
                <parameter key="accuracy" value="true"/>
                <parameter key="classification_error" value="false"/>
                <parameter key="kappa" value="false"/>
                <parameter key="weighted_mean_recall" value="false"/>
                <parameter key="weighted_mean_precision" value="false"/>
                <parameter key="spearman_rho" value="false"/>
                <parameter key="kendall_tau" value="false"/>
                <parameter key="absolute_error" value="false"/>
                <parameter key="relative_error" value="false"/>
                <parameter key="relative_error_lenient" value="false"/>
                <parameter key="relative_error_strict" value="false"/>
                <parameter key="normalized_absolute_error" value="false"/>
                <parameter key="root_mean_squared_error" value="false"/>
                <parameter key="root_relative_squared_error" value="false"/>
                <parameter key="squared_error" value="false"/>
                <parameter key="correlation" value="false"/>
                <parameter key="squared_correlation" value="false"/>
                <parameter key="cross-entropy" value="false"/>
                <parameter key="margin" value="false"/>
                <parameter key="soft_margin_loss" value="false"/>
                <parameter key="logistic_loss" value="false"/>
                <parameter key="skip_undefined_labels" value="true"/>
                <parameter key="use_example_weights" value="true"/>
                <list key="class_weights"/>
              </operator>
              <connect from_port="model" to_op="Apply Model (3)" to_port="model"/>
              <connect from_port="test set" to_op="Select by Weights (2)" to_port="example set input"/>
              <connect from_port="through 1" to_port="performance 2"/>
              <connect from_port="through 2" to_op="Select by Weights (2)" to_port="weights"/>
              <connect from_op="Select by Weights (2)" from_port="example set output" to_op="Apply Model (3)" to_port="unlabelled data"/>
              <connect from_op="Apply Model (3)" from_port="labelled data" to_op="Test_performance" to_port="labelled data"/>
              <connect from_op="Test_performance" from_port="performance" to_port="performance 1"/>
              <portSpacing port="source_model" spacing="0"/>
              <portSpacing port="source_test set" spacing="0"/>
              <portSpacing port="source_through 1" spacing="0"/>
              <portSpacing port="source_through 2" spacing="0"/>
              <portSpacing port="source_through 3" spacing="0"/>
              <portSpacing port="sink_test set results" spacing="0"/>
              <portSpacing port="sink_performance 1" spacing="0"/>
              <portSpacing port="sink_performance 2" spacing="0"/>
              <portSpacing port="sink_performance 3" spacing="0"/>
            </process>
          </operator>
          <connect from_op="Retrieve Sonar" from_port="output" to_op="Cross Validation" to_port="example set"/>
          <connect from_op="Cross Validation" from_port="performance 1" to_port="result 1"/>
          <connect from_op="Cross Validation" from_port="performance 2" to_port="result 2"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="0"/>
          <portSpacing port="sink_result 3" spacing="0"/>
        </process>
      </operator>
    </process>
    

    Hope this helps,

    Regards,

    Lionel

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.