Package smile.classification
Class BinarySparseLinearSVM
java.lang.Object
smile.classification.AbstractClassifier<int[]>
smile.classification.BinarySparseLinearSVM
- All Implemented Interfaces:
Serializable
,ToDoubleFunction<int[]>
,ToIntFunction<int[]>
,Classifier<int[]>
Binary sparse linear support vector machines for classification.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface smile.classification.Classifier
Classifier.Trainer<T,
M extends Classifier<T>> -
Field Summary
Fields inherited from class smile.classification.AbstractClassifier
classes
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class smile.classification.AbstractClassifier
classes, numClasses
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface smile.classification.Classifier
applyAsDouble, applyAsInt, online, predict, predict, predict, predict, predict, predict, predict, soft, update, update, update
-
Constructor Details
-
BinarySparseLinearSVM
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
public int predict(int[] x) Description copied from interface:Classifier
Predicts the class label of an instance.- Parameters:
x
- the instance to be classified.- Returns:
- the predicted class label.
-
score
public double score(int[] x) Description copied from interface:Classifier
The raw prediction score.- Parameters:
x
- the instance to be classified.- Returns:
- the raw prediction score.
-