edu.udo.cs.yale.operator.learner.kernel
Class AbstractMySVMModel
java.lang.Object
edu.udo.cs.yale.operator.AbstractIOObject
edu.udo.cs.yale.operator.ResultObjectAdapter
edu.udo.cs.yale.operator.AbstractModel
edu.udo.cs.yale.operator.IOModel
edu.udo.cs.yale.operator.learner.PredictionModel
edu.udo.cs.yale.operator.learner.kernel.KernelModel
edu.udo.cs.yale.operator.learner.kernel.AbstractMySVMModel
- All Implemented Interfaces:
- IOObject, Model, ResultObject, Saveable
- Direct Known Subclasses:
- JMySVMModel, MyKLRModel
public abstract class AbstractMySVMModel
- extends KernelModel
The abstract superclass for the SVM models by Stefan Rueping.
- Version:
- $Id: AbstractMySVMModel.java,v 1.11 2006/03/27 13:22:01 ingomierswa
Exp $
- Author:
- Ingo Mierswa
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
model
private ExampleSet model
kernel
private Kernel kernel
kernelType
private int kernelType
AbstractMySVMModel
public AbstractMySVMModel()
AbstractMySVMModel
public AbstractMySVMModel(Attribute labelAttribute)
AbstractMySVMModel
public AbstractMySVMModel(Attribute labelAttribute,
ExampleSet model,
Kernel kernel,
int kernelType)
createSVM
public abstract SVMInterface createSVM()
- Creates a new SVM for prediction.
getModelInfo
public java.lang.String getModelInfo()
- Specified by:
getModelInfo in class KernelModel
isClassificationModel
public boolean isClassificationModel()
- Specified by:
isClassificationModel 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
getNumberOfExamples
public int getNumberOfExamples()
- Specified by:
getNumberOfExamples 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 ExampleSet 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.
readPredictionModelData
public void readPredictionModelData(java.io.ObjectInputStream in)
throws java.io.IOException
- Reads the support vectors and the kernel from the input stream.
- Specified by:
readPredictionModelData in class PredictionModel
- Throws:
java.io.IOException
writePredictionModelData
public void writePredictionModelData(java.io.ObjectOutputStream out)
throws java.io.IOException
- Writes the support vectors and the kernel into the input stream.
- Specified by:
writePredictionModelData in class PredictionModel
- Throws:
java.io.IOException
performPrediction
public void performPrediction(ExampleSet exampleSet,
Attribute predictedLabelAttribute)
throws OperatorException
- Description copied from class:
PredictionModel
- Subclasses should iterated 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
toString
public java.lang.String toString()
- Overrides:
toString in class PredictionModel
Copyright © 2001-2006