Class SparseLinearSVM
- All Implemented Interfaces:
Serializable, ToDoubleFunction<SparseArray>, ToIntFunction<SparseArray>, Classifier<SparseArray>
Sparse linear support vector machines for classification.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface Classifier
Classifier.Trainer<T,M> -
Field Summary
Fields inherited from class AbstractClassifier
classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the intercept.intPredicts the class label of an instance.doublescore(SparseArray x) The raw prediction score.double[]weights()Returns the linear weights.Methods inherited from class AbstractClassifier
classes, numClassesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Classifier
applyAsDouble, applyAsInt, online, predict, predict, predict, predict, predict, predict, predict, soft, 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:ClassifierPredicts the class label of an instance.- Parameters:
x- the instance to be classified.- Returns:
- the predicted class label.
-
score
Description copied from interface:ClassifierThe raw prediction score.- Parameters:
x- the instance to be classified.- Returns:
- the raw prediction score.
-