Class SVOneClass
java.lang.Object
com.imsl.datamining.PredictiveModel
com.imsl.datamining.supportvectormachine.SupportVectorMachine
com.imsl.datamining.supportvectormachine.SVOneClass
- All Implemented Interfaces:
Serializable,Cloneable
Specifies a support vector machine for the one class problem. The one class
SVM estimates the support (the range of values with positive density) of a
high-dimensional distribution.
The one-class SVM algorithm estimates the support of a high-dimensional distribution without any class information. The primal problem of one-class SVM is
$$\min_ {w, \xi, \rho} \frac{1}{2} w^Tw-\rho+\frac{1}{\nu l}\sum_{i=1}^{l} \xi _i$$
$$\text{subject to} \, \, (w^T \phi (x_i)) \geq \rho - \xi _i,$$
$$ \xi _i \geq 0, i=1, \, \ldots \,,\,l$$
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.imsl.datamining.supportvectormachine.SupportVectorMachine
SupportVectorMachine.ReflectiveOperationExceptionNested classes/interfaces inherited from class com.imsl.datamining.PredictiveModel
PredictiveModel.CloneNotSupportedException, PredictiveModel.PredictiveModelException, PredictiveModel.StateChangeException, PredictiveModel.SumOfProbabilitiesNotOneException, PredictiveModel.VariableType -
Constructor Summary
ConstructorsConstructorDescriptionSVOneClass(double[][] xy, int responseColumnIndex, PredictiveModel.VariableType[] varType) Constructs a one class support vector machine.SVOneClass(double[][] xy, int responseColumnIndex, PredictiveModel.VariableType[] varType, Kernel k) Constructs a one class support vector machine.SVOneClass(SVOneClass oneClassModel) Constructs a copy of the inputSVOneClasspredictive model. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones anSVOneClasspredictive model.protected SVModelPerforms the one class support vector machine optimization problem.protected double[]predictValues(SVModel model, double[][] attributeData) Generates the predicted values on the attribute data using the given support vector machine model.Methods inherited from class com.imsl.datamining.supportvectormachine.SupportVectorMachine
fitModel, getConvergenceTolerance, getKernel, getKernelParameters, getModel, getNuParameter, getRegularizationParameter, getWorkingArraySize, isNuFormulation, isProbability, isShrinking, predict, predict, setConfiguration, setConvergenceTolerance, setKernel, setKernelParameters, setNuFormulation, setNuParameter, setProbability, setRegularizationParameter, setShrinking, setWorkArraySizeMethods inherited from class com.imsl.datamining.PredictiveModel
getClassCounts, getClassErrors, getClassErrors, getClassLabels, getClassProbabilities, getCostMatrix, getMaxNumberOfCategories, getMaxNumberOfIterations, getNumberOfClasses, getNumberOfColumns, getNumberOfMissing, getNumberOfPredictors, getNumberOfRows, getNumberOfUniquePredictorValues, getPredictorIndexes, getPredictorTypes, getPrintLevel, getPriorProbabilities, getRandomObject, getResponseColumnIndex, getResponseVariableAverage, getResponseVariableMostFrequentClass, getResponseVariableType, getTotalWeight, getVariableType, getWeights, getXY, isConstantSeries, isMustFitModel, isUserFixedNClasses, setClassCounts, setClassLabels, setClassProbabilities, setCostMatrix, setMaxNumberOfCategories, setMaxNumberOfIterations, setMustFitModel, setNumberOfClasses, setPredictorIndex, setPredictorTypes, setPrintLevel, setPriorProbabilities, setRandomObject, setResponseColumnIndex, setTrainingData, setVariableType, setWeights
-
Constructor Details
-
SVOneClass
Constructs a one class support vector machine.- Parameters:
xy- adoublematrix containing the training data and associated response values by the number of variablesresponseColumnIndex- anint, the column index of the response variablevarType- aPredictiveModel.VariableTypearray of length equal toxy[0].lengthcontaining the type of each variable
-
SVOneClass
public SVOneClass(double[][] xy, int responseColumnIndex, PredictiveModel.VariableType[] varType, Kernel k) Constructs a one class support vector machine.- Parameters:
xy- adoublematrix containing the training data and associated response valuesresponseColumnIndex- anint, the column index of the response variablevarType- aPredictiveModel.VariableTypearray of length equal toxy[0].lengthcontaining the type of each variablek- aKernel, the kernel function
-
SVOneClass
Constructs a copy of the inputSVOneClasspredictive model.- Parameters:
oneClassModel- anSVOneClasspredictive model
-
-
Method Details
-
clone
Clones anSVOneClasspredictive model.- Specified by:
clonein classPredictiveModel- Returns:
- a clone of the
SVOneClasspredictive model
-
optimize
protected SVModel optimize(DataNode[][] x, double[] y, double[] w, int len, Kernel kernel) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Performs the one class support vector machine optimization problem.- Specified by:
optimizein classSupportVectorMachine- Parameters:
x- aDataNodematrix containing the attribute datay- adoublearray containing the response variablelen- anint, the total possible number of support vectorsw- adoublearray containing the observation weightskernel- aKernelobject- Returns:
- an
SVModelstructure containing the fitted model - Throws:
NoSuchMethodException- thrown when a particular method cannot be foundInstantiationException- thrown when an application tries to create an instance of a class using thenewInstancemethod in classClass, but the specified class object cannot be instantiated.IllegalAccessException- thrown when an application tries to reflectively create an instance (other than an array), set or get a field, or invoke a method, but the currently executing method does not have access to the definition of the specified class, field, method or constructorInvocationTargetException- a checked exception that wraps an exception thrown by an invoked method or constructor
-
predictValues
protected double[] predictValues(SVModel model, double[][] attributeData) throws PredictiveModel.SumOfProbabilitiesNotOneException Generates the predicted values on the attribute data using the given support vector machine model.- Specified by:
predictValuesin classSupportVectorMachine- Parameters:
model- a fittedSVModelobjectattributeData- adoublematrix containing the attribute (or predictor) data- Returns:
- a
doublearray containing the predictions for each row in the input attribute data - Throws:
PredictiveModel.SumOfProbabilitiesNotOneException- the sum of probabilities is not approximately one
-