com.rapidminer.operator.learner.functions.kernel
Class AbstractMySVMModel

java.lang.Object
  extended by com.rapidminer.operator.AbstractIOObject
      extended by com.rapidminer.operator.ResultObjectAdapter
          extended by com.rapidminer.operator.AbstractModel
              extended by com.rapidminer.operator.learner.PredictionModel
                  extended by com.rapidminer.operator.learner.functions.kernel.KernelModel
                      extended by com.rapidminer.operator.learner.functions.kernel.AbstractMySVMModel
All Implemented Interfaces:
IOObject, FormulaProvider, Model, ResultObject, Saveable, Readable, Reportable, LoggingHandler, java.io.Serializable
Direct Known Subclasses:
JMySVMModel, MyKLRModel

public abstract class AbstractMySVMModel
extends KernelModel
implements FormulaProvider

The abstract superclass for the SVM models by Stefan Rueping.

Author:
Ingo Mierswa
See Also:
Serialized Form

Constructor Summary
AbstractMySVMModel(ExampleSet exampleSet, SVMExamples model, Kernel kernel, int kernelType)
           
 
Method Summary
abstract  SVMInterface createSVM()
          Creates a new SVM for prediction.
 double getAlpha(int index)
           
 double getAttributeValue(int exampleIndex, int attributeIndex)
           
 double getBias()
           
 java.lang.String getClassificationLabel(int index)
           
 SVMExamples getExampleSet()
          Gets the model, i.e. an SVM example set.
 java.lang.String getFormula()
           
 double getFunctionValue(int index)
           
 java.lang.String getId(int index)
           
 Kernel getKernel()
          Gets the kernel.
 int getNumberOfAttributes()
           
 int getNumberOfSupportVectors()
           
 double getRegressionLabel(int index)
           
 SupportVector getSupportVector(int index)
          This method must divide the alpha by the label since internally the alpha value is already multiplied with y.
 boolean isClassificationModel()
           
 ExampleSet performPrediction(ExampleSet exampleSet, Attribute predictedLabelAttribute)
          Subclasses should iterate through the given example set and set the prediction for each example.
abstract  void setPrediction(Example example, double prediction)
          Sets the correct prediction to the example from the result value of the SVM.
 
Methods inherited from class com.rapidminer.operator.learner.functions.kernel.KernelModel
createWeightsTable, getAttributeConstructions, getName, getVisualizationComponent, toString
 
Methods inherited from class com.rapidminer.operator.learner.PredictionModel
apply, checkCompatibility, copyPredictedLabel, createPredictedLabel, getLabel, removePredictedLabel, removePredictedLabel
 
Methods inherited from class com.rapidminer.operator.AbstractModel
getExtension, getFileDescription, getResultIcon, getTrainingHeader, isUpdatable, setParameter, updateModel
 
Methods inherited from class com.rapidminer.operator.ResultObjectAdapter
addAction, getActions, isSavable, log, logError, logNote, logWarning, save, toHTML, toResultString
 
Methods inherited from class com.rapidminer.operator.AbstractIOObject
copy, getLog, getSource, initWriting, read, setLoggingHandler, setSource, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rapidminer.operator.Model
apply, isUpdatable, setParameter, updateModel
 
Methods inherited from interface com.rapidminer.operator.ResultObject
getActions, getName, getResultIcon, getVisualizationComponent, toResultString
 
Methods inherited from interface com.rapidminer.operator.IOObject
copy, getLog, getSource, setLoggingHandler, setSource, write
 
Methods inherited from interface com.rapidminer.operator.Saveable
getExtension, getFileDescription, isSavable, save
 
Methods inherited from interface com.rapidminer.report.Readable
toString
 

Constructor Detail

AbstractMySVMModel

public AbstractMySVMModel(ExampleSet exampleSet,
                          SVMExamples model,
                          Kernel kernel,
                          int kernelType)
Method Detail

createSVM

public abstract SVMInterface createSVM()
Creates a new SVM for prediction.


isClassificationModel

public boolean isClassificationModel()
Specified by:
isClassificationModel in class KernelModel

getBias

public double getBias()
Specified by:
getBias in class KernelModel

getSupportVector

public SupportVector getSupportVector(int index)
This method must divide the alpha by the label since internally the alpha value is already multiplied with y.

Specified by:
getSupportVector in class KernelModel

getAlpha

public double getAlpha(int index)
Specified by:
getAlpha in class KernelModel

getId

public java.lang.String getId(int index)
Specified by:
getId in class KernelModel

getNumberOfSupportVectors

public int getNumberOfSupportVectors()
Specified by:
getNumberOfSupportVectors in class KernelModel

getNumberOfAttributes

public int getNumberOfAttributes()
Specified by:
getNumberOfAttributes in class KernelModel

getAttributeValue

public double getAttributeValue(int exampleIndex,
                                int attributeIndex)
Specified by:
getAttributeValue in class KernelModel

getClassificationLabel

public java.lang.String getClassificationLabel(int index)
Specified by:
getClassificationLabel in class KernelModel

getRegressionLabel

public double getRegressionLabel(int index)
Specified by:
getRegressionLabel in class KernelModel

getFunctionValue

public double getFunctionValue(int index)
Specified by:
getFunctionValue in class KernelModel

getKernel

public Kernel getKernel()
Gets the kernel.


getExampleSet

public SVMExamples getExampleSet()
Gets the model, i.e. an SVM example set.


setPrediction

public abstract void setPrediction(Example example,
                                   double prediction)
Sets the correct prediction to the example from the result value of the SVM.


performPrediction

public ExampleSet performPrediction(ExampleSet exampleSet,
                                    Attribute predictedLabelAttribute)
                             throws OperatorException
Description copied from class: PredictionModel
Subclasses should iterate through the given example set and set the prediction for each example. The given predicted label attribute was already be added to the example set and should be used to set the predicted values.

Specified by:
performPrediction in class PredictionModel
Throws:
OperatorException

getFormula

public java.lang.String getFormula()
Specified by:
getFormula in interface FormulaProvider


Copyright © 2001-2009 by Rapid-I