Class SVRegression
- All Implemented Interfaces:
Serializable,Cloneable
The standard form SVR is the so-called epsilon-support vector regression, or \(\varepsilon\)-SVR. If \(z_i\) is the target output, then given the parameters \(C > \, 0, \varepsilon > \, 0\), the standard form SVR is
$$\min_ {w, b, \xi, \xi^*} \frac{1}{2} w^Tw+C\sum_{i=1}^{l} \xi _i + C\sum_{i=1}^{l} {\xi _i}^*$$
$$\text{subject to} \, \, w^T \phi (x_i)+b-z_i \leq \varepsilon +\xi _i,$$
$$z_i - w^T \phi (x_i)-b \leq \varepsilon +{\xi _i}^*,$$
$$ \xi_i, {\xi_i}^* \geq 0, i=1, \ldots, l $$
The variables \(\xi _i\) and
\({\xi _i}^*\) are two slack variables, one for exceeding
the target value by more than
\(\epsilon\) and the other for being more than
\(\epsilon\) below the target.
\(\epsilon\) is controlled through the use of the set method
setInsensitivityBand.
- 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
ConstructorsConstructorDescriptionSVRegression(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).SVRegression(SVRegression svrModel) Constructs a copy of the inputSVRegressionpredictive model. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones anSVRegressionpredictive model.doubleReturns the insensitivity band parameter, \(\epsilon\), in the standard formulation of the SVM regression problem.protected SVModelPerforms 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 final voidSets the configuration to that of the inputPredictiveModel.voidsetInsensitivityBand(double epsilon) Sets the insensitivity band parameter, \(\epsilon\), in the standard formulation of the SVM regression problem.Methods inherited from class com.imsl.datamining.supportvectormachine.SupportVectorMachine
fitModel, getConvergenceTolerance, getKernel, getKernelParameters, getModel, getNuParameter, getRegularizationParameter, getWorkingArraySize, isNuFormulation, isProbability, isShrinking, predict, predict, 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
-
SVRegression
Constructs a support vector machine for regression (SVR).- Parameters:
xy- adoublematrix containing the training data and associated response valuesresponseColumnIndex- anintspecifying the column index of the response variablevarType- aPredictiveModel.VariableTypearray of length equal toxy[0].lengthcontaining the type of each variable
-
SVRegression
Constructs a copy of the inputSVRegressionpredictive model.- Parameters:
svrModel- anSVRegressionpredictive model
-
SVRegression
public SVRegression(double[][] xy, int responseColumnIndex, PredictiveModel.VariableType[] varType, Kernel k) Constructs a support vector machine for regression (SVR).- Parameters:
xy- adoublematrix containing the training data and associated response valuesresponseColumnIndex- anintspecifying the column index of the response variablevarType- aPredictiveModel.VariableTypearray of length equal toxy[0].lengthcontaining the type of each variablek- aKernel, the kernel function
-
-
Method Details
-
clone
Clones anSVRegressionpredictive model.- Specified by:
clonein classPredictiveModel- Returns:
- a clone of the
SVRegressionpredictive model
-
setConfiguration
Sets the configuration to that of the inputPredictiveModel.Note that the input
PredictiveModelobject must be the same subclass ofPredictiveModelas is this instance.- Overrides:
setConfigurationin classSupportVectorMachine- Parameters:
pm- aSVRegressioninstanceDefault: The class uses its default configuration as described in the different methods.
-
getInsensitivityBand
public double getInsensitivityBand()Returns the insensitivity band parameter, \(\epsilon\), in the standard formulation of the SVM regression problem.- Returns:
- a
double, the value of the insensitivity band parameter
-
setInsensitivityBand
public void setInsensitivityBand(double epsilon) Sets the insensitivity band parameter, \(\epsilon\), in the standard formulation of the SVM regression problem.- Parameters:
epsilon- adouble> 0.0, the value of the infeasibility band parameterDefault:
epsilon=0.1
-
optimize
protected SVModel optimize(DataNode[][] x, double[] y, double[] w, int len, Kernel kernel) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Performs the regression 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 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 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
-