public class SVRegression extends SupportVectorMachine
The standard form SVR is the so-called epsilon-support vector regression, or -SVR. If is the target output, then given the parameters , the standard form SVR is
The variables and
are two slack variables, one for exceeding
the target value by more than
and the other for being more than
below the target.
is controlled through the use of the set method
setInsensitivityBand
.
SupportVectorMachine.CloneNotSupportedException, SupportVectorMachine.ReflectiveOperationException
PredictiveModel.PredictiveModelException, PredictiveModel.StateChangeException, PredictiveModel.SumOfProbabilitiesNotOneException, PredictiveModel.VariableType
Constructor and Description |
---|
SVRegression(double[][] xy,
int responseColumnIndex,
PredictiveModel.VariableType[] varType)
Constructs a support vector machine for regression (SVR).
|
SVRegression(double[][] xy,
int responseColumnIndex,
PredictiveModel.VariableType[] varType,
Kernel k)
Constructs a support vector machine for regression (SVR).
|
Modifier and Type | Method and Description |
---|---|
double |
getInsensitivityBand()
Returns the insensitivity band parameter,
, in the standard formulation of the SVM
regression problem.
|
protected SVModel |
optimize(DataNode[][] x,
double[] y,
double[] w,
int len,
Kernel kernel)
Performs the regression 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.
|
protected void |
setConfiguration(PredictiveModel pm)
Sets the configuration to that of the input
PredictiveModel . |
void |
setInsensitivityBand(double epsilon)
Sets the insensitivity band parameter, , in
the standard formulation of the SVM regression problem.
|
fitModel, getConvergenceTolerance, getKernel, getKernelParameters, getModel, getNuParameter, getRegularizationParameter, getWorkingArraySize, isNuFormulation, isProbability, isShrinking, predict, predict, setConvergenceTolerance, setKernel, setKernelParameters, setNuFormulation, setNuParameter, setProbability, setRegularizationParameter, setShrinking, setWorkArraySize
getClassCounts, 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, isMustFitModel, isUserFixedNClasses, predict, setClassCounts, setClassLabels, setClassProbabilities, setCostMatrix, setMaxNumberOfCategories, setMaxNumberOfIterations, setMustFitModel, setNumberOfClasses, setPredictorIndex, setPredictorTypes, setPrintLevel, setPriorProbabilities, setRandomObject, setResponseColumnIndex, setTrainingData, setVariableType, setWeights
public SVRegression(double[][] xy, int responseColumnIndex, PredictiveModel.VariableType[] varType)
xy
- a double
matrix containing the training data and
associated response valuesresponseColumnIndex
- an int
specifying the column
index of the response variablevarType
- a PredictiveModel.VariableType
array of
length equal to xy[0].length
containing the type of each
variablepublic SVRegression(double[][] xy, int responseColumnIndex, PredictiveModel.VariableType[] varType, Kernel k) throws CloneNotSupportedException
xy
- a double
matrix containing the training data and
associated response valuesresponseColumnIndex
- an int
specifying the column
index of the response variablevarType
- a PredictiveModel.VariableType
array of
length equal to xy[0].length
containing the type of each
variablek
- a Kernel
, the kernel functionCloneNotSupportedException
- thrown to indicate that the
clone
method in class Object
has been called
to clone an object, but that the object's class does not implement the
Cloneable
interfacepublic double getInsensitivityBand()
double
, the value of the insensitivity band
parameterprotected SVModel optimize(DataNode[][] x, double[] y, double[] w, int len, Kernel kernel) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
optimize
in class SupportVectorMachine
x
- a DataNode
matrix containing the attribute datay
- a double
array containing the response variablelen
- an int
, the total possible number of support
vectorsw
- a double
array containing the observation weightskernel
- a Kernel
objectSVModel
structure containing the fitted modelNoSuchMethodException
- thrown when a particular method
cannot be foundInstantiationException
- thrown when an application tries
to create an instance of a class using the newInstance
method in class Class
, but the specified class object cannot
be instantiatedIllegalAccessException
- 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 constructorprotected double[] predictValues(SVModel model, double[][] attributeData) throws PredictiveModel.SumOfProbabilitiesNotOneException
predictValues
in class SupportVectorMachine
model
- a fitted SVModel
objectattributeData
- a double
matrix containing the
attribute (or predictor) datadouble
array containing the predictions for each
row in the input attribute dataPredictiveModel.SumOfProbabilitiesNotOneException
- the
sum of probabilities is not approximately oneprotected void setConfiguration(PredictiveModel pm) throws SupportVectorMachine.CloneNotSupportedException
PredictiveModel
.
Note that the input PredictiveModel
object must be the same
subclass of PredictiveModel
as is this instance.
setConfiguration
in class SupportVectorMachine
pm
- a SVRegression
instanceCloneNotSupportedException
- a
java.lang.CloneNotSupportedException
has occurred. The
original exception has been added to the
SupportVectorMachine.CloneNotSupportedException
as a
suppressed exception.
Default: The class uses its default configuration as described in the different methods.
SupportVectorMachine.CloneNotSupportedException
public void setInsensitivityBand(double epsilon)
epsilon
- a double
> 0.0, the value of the
infeasibility band parameter
Default: epsilon
=0.1
Copyright © 1970-2016 Rogue Wave Software
Built May 19 2016.