"Classification performance of one-class SVM"

TobiasMalbrechtTobiasMalbrecht Moderator, Employee, Member Posts: 294 RM Product Management
edited May 2019 in Help
Posted in SourceForge forum at http://sourceforge.net/forum/forum.php?thread_id=2185902&forum_id=390413:


Does anybody have any example/project they are willing to share showing the
use of one-class libSVM; I've been playing around with rapidminer for the past
day (which is amazing btw-- tnx!) but using the one-class and modifying any
of the parameters (gamma, coef, C, nu, etc.) does not affect the classification
result which is 100%. I've even modified the data on purpose (to mess it up)
and no luck on seeing any changes.

I've also exported the data (as an arff file) and imported it in to Weka and
the results were more reasonable (changing gamma from 0.01 to 0.07 changed the
classification correctness to ~88%). (This might be off topic, but if anybody
knows how to do PCA on one-class data set in Weka that would be also helpful)

Here is the simplified model xml file:

<operator name="Root" class="Process" expanded="yes">
    <parameter key="logfile" value="/home/d/rm_workspace/log.log"/>
    <parameter key="resultfile" value="/home/d/rm_workspace/results.res"/>
    <operator name="ArffExampleSource" class="ArffExampleSource">
        <parameter key="data_file" value="file.arff"/>
        <parameter key="label_attribute" value="class"/>
    </operator>
    <operator name="Normalization" class="Normalization">
        <parameter key="min" value="-1.0"/>
    </operator>
    <operator name="PCA" class="PCA">
    </operator>
    <operator name="XValidation" class="XValidation" expanded="yes">
        <operator name="LibSVMLearner" class="LibSVMLearner">
            <parameter key="cache_size" value="150"/>
            <list key="class_weights">
            </list>
            <parameter key="coef0" value="0.03125"/>
            <parameter key="confidence_for_multiclass" value="false"/>
            <parameter key="degree" value="1"/>
            <parameter key="gamma" value="0.01"/>
            <parameter key="nu" value="9.765625E-4"/>
            <parameter key="svm_type" value="one-class"/>
        </operator>
        <operator name="OperatorChain" class="OperatorChain" expanded="yes">
            <operator name="ModelApplier (2)" class="ModelApplier">
                <list key="application_parameters">
                </list>
            </operator>
            <operator name="Performance" class="Performance">
            </operator>
        </operator>
    </operator>
</operator>
Any help is very much appreciated! Thanks!
Tagged:

Answers

  • Legacy UserLegacy User Member Posts: 0 Newbie
    I'm not sure the PCA in this example has any effect - it simply generates the PCA model.

    To transform the data you need to add ModelApplier immediately after the PCA step.

  • deiandeian Member Posts: 1 Contributor I
    In the original I did have the mode applier (see attached) -- i just posted the wrong model -- sorry  :-\

    in any case I also tried with and even simpler example:

    <?xml version="1.0" encoding="US-ASCII"?>
    <process version="4.2">

      <operator name="Root" class="Process" expanded="yes">
          <operator name="ArffExampleSource" class="ArffExampleSource" breakpoints="after">
              <parameter key="data_file"    value="/home/d/rm_workspace/a.arff"/>
              <parameter key="label_attribute"      value="class"/>
          </operator>
          <operator name="XValidation" class="XValidation" expanded="yes">
              <operator name="LibSVMLearner" class="LibSVMLearner">
                  <list key="class_weights">
                  </list>
                  <parameter key="svm_type" value="one-class"/>
              </operator>
              <operator name="OperatorChain" class="OperatorChain" expanded="yes">
                  <operator name="ModelApplier" class="ModelApplier">
                      <list key="application_parameters">
                      </list>
                  </operator>
                  <operator name="Performance" class="Performance">
                  </operator>
              </operator>
          </operator>
      </operator>

    </process>
    where the arff file is:

    relation simple

    @attribute value numeric
    @attribute class {a}
         
    @data  
    1,a     
    1,a 
    1,a 
    1,a     
    1,a         
    1,a         
    1,a         
    1,a     
    1,a     
    1,a         
    1,a             
    1,a             
    1,a         
    1,a         
    1,a         
    1,a     
    1,a 
    1,a
    1,a
    1,a
    1,a
    ...
    -1,a
    -1,a
    -1,a
    and the class prediction is 100%

    [attachment deleted by admin]
Sign In or Register to comment.