"[SOLVED] Logging Confidences in X-Validation"

Skyfaller
Skyfaller New Altair Community Member
edited November 2024 in Community Q&A
Hi Guys,

okay i have a little problem which i cant seem to solve on my own.
The thing is:
I have a Cross-Validation. As usual in the Training part is the "classifier" (SVM with "calculate confidence") and in the Test part the "apply model" and "performance" Operator.

Now I want to write the confidences to a file. But the outputs of the Cross-Validation doesn't give me the confidences back.

Now i'm trying to write the confidences in the Testing part to a file(write-csv), this seems to work, but unfortunately it overwrites the file in each Step. Which means i only get the last 1/10th of the Data in the File.

In short: Is there any way to write the Output (labelled date) of the "apply model" operator to a file for every iteration of the cross-validation?
If possible to a single file.

Thanks,
Nic

Answers

  • haddock
    haddock New Altair Community Member
    Hi there,

    Is this what you had in mind?
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.1.013">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.1.013" expanded="true" name="Root">
        <process expanded="true" height="584" width="915">
          <operator activated="true" class="retrieve" compatibility="5.1.013" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
            <parameter key="repository_entry" value="../../data/Labor-Negotiations"/>
          </operator>
          <operator activated="true" class="replace_missing_values" compatibility="5.1.013" expanded="true" height="94" name="MissingValueReplenishment" width="90" x="180" y="30">
            <list key="columns"/>
          </operator>
          <operator activated="true" class="x_validation" compatibility="5.1.013" expanded="true" height="112" name="XValidation" width="90" x="315" y="30">
            <parameter key="number_of_validations" value="5"/>
            <process expanded="true" height="347" width="385">
              <operator activated="true" class="k_nn" compatibility="5.1.013" expanded="true" height="76" name="NearestNeighbors" width="90" x="152" y="30">
                <parameter key="k" value="3"/>
              </operator>
              <connect from_port="training" to_op="NearestNeighbors" to_port="training set"/>
              <connect from_op="NearestNeighbors" from_port="model" to_port="model"/>
              <portSpacing port="source_training" spacing="0"/>
              <portSpacing port="sink_model" spacing="0"/>
              <portSpacing port="sink_through 1" spacing="0"/>
            </process>
            <process expanded="true" height="347" width="413">
              <operator activated="true" class="apply_model" compatibility="5.1.013" expanded="true" height="76" name="ModelApplier" width="90" x="45" y="30">
                <list key="application_parameters"/>
              </operator>
              <operator activated="true" class="write_special" compatibility="5.1.013" expanded="true" height="60" name="Write Special Format" width="90" x="147" y="166">
                <parameter key="example_set_file" value="C:\Documents and Settings\Administrator.KNOWLEDG-P6715Y\My Documents\out.dat"/>
                <parameter key="special_format" value="$d"/>
              </operator>
              <operator activated="true" class="performance_classification" compatibility="5.1.013" expanded="true" height="76" name="ClassificationPerformance" width="90" x="246" y="30">
                <parameter key="accuracy" value="false"/>
                <parameter key="classification_error" value="true"/>
                <list key="class_weights"/>
              </operator>
              <connect from_port="model" to_op="ModelApplier" to_port="model"/>
              <connect from_port="test set" to_op="ModelApplier" to_port="unlabelled data"/>
              <connect from_op="ModelApplier" from_port="labelled data" to_op="Write Special Format" to_port="input"/>
              <connect from_op="Write Special Format" from_port="through" to_op="ClassificationPerformance" to_port="labelled data"/>
              <connect from_op="ClassificationPerformance" from_port="performance" to_port="averagable 1"/>
              <portSpacing port="source_model" spacing="0"/>
              <portSpacing port="source_test set" spacing="0"/>
              <portSpacing port="source_through 1" spacing="0"/>
              <portSpacing port="sink_averagable 1" spacing="0"/>
              <portSpacing port="sink_averagable 2" spacing="0"/>
            </process>
          </operator>
          <connect from_op="Retrieve" from_port="output" to_op="MissingValueReplenishment" to_port="example set input"/>
          <connect from_op="MissingValueReplenishment" from_port="example set output" to_op="XValidation" to_port="training"/>
          <connect from_op="XValidation" from_port="averagable 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>
    Hope so!
  • Skyfaller
    Skyfaller New Altair Community Member
    Hi Haddock,

    first of all a BIG Thanks :)

    Yeah thats exactly what i had in mind.
    Seems to work perfectly :)

    Thank you very very much!

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.