Class SparseLinearSVM
java.lang.Object
smile.regression.SparseLinearSVM
- All Implemented Interfaces:
Serializable, ToDoubleFunction<SparseArray>, Regression<SparseArray>
Sparse linear support vector machines for regression.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Regression
Regression.Trainer<T,M> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the intercept.doublePredicts the dependent variable of an instance.double[]weights()Returns the linear weights.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Regression
applyAsDouble, online, predict, predict, predict, update, update, update
-
Constructor Details
-
SparseLinearSVM
Constructor.- Parameters:
p- the dimension of input vector.svm- The kernel machine.
-
-
Method Details
-
weights
public double[] weights()Returns the linear weights.- Returns:
- the linear weights.
-
intercept
public double intercept()Returns the intercept.- Returns:
- the intercept.
-
predict
Description copied from interface:RegressionPredicts the dependent variable of an instance.- Specified by:
predictin interfaceRegression<SparseArray>- Parameters:
x- an instance.- Returns:
- the predicted value of dependent variable.
-