Expand description
Fitted Support Vector Machines model
This is the result of the SMO optimizer and contains the support vectors, quality of solution and optionally the linear hyperplane.
Fields
alpha: Vec<F>
rho: F
Implementations
sourceimpl<F: Float, T> Svm<F, T>
impl<F: Float, T> Svm<F, T>
sourcepub fn nsupport(&self) -> usize
pub fn nsupport(&self) -> usize
Returns the number of support vectors
This function returns the number of support vectors which have an influence on the decision outcome greater than zero.
sourcepub fn weighted_sum<D: Data<Elem = F>>(&self, sample: &ArrayBase<D, Ix1>) -> F
pub fn weighted_sum<D: Data<Elem = F>>(&self, sample: &ArrayBase<D, Ix1>) -> F
Sums the inner product of sample
and every one of the support vectors.
Parameters
sample
: the input sample
Returns
The sum of all inner products of sample
and every one of the support vectors, scaled by their weight.
Panics
If the shape of sample
is not compatible with the
shape of the support vectors
Trait Implementations
sourceimpl<'a, F: Float, T> Display for Svm<F, T>
impl<'a, F: Float, T> Display for Svm<F, T>
Display solution
In order to understand the solution of the SMO solver the objective, number of iterations and required support vectors are printed here.
sourceimpl<F: Float, D: Data<Elem = F>> Predict<ArrayBase<D, Dim<[usize; 1]>>, Pr> for Svm<F, Pr>
impl<F: Float, D: Data<Elem = F>> Predict<ArrayBase<D, Dim<[usize; 1]>>, Pr> for Svm<F, Pr>
Predict a probability with a feature vector
sourceimpl<'a, F: Float, D: Data<Elem = F>> Predict<ArrayBase<D, Dim<[usize; 1]>>, bool> for Svm<F, bool>
impl<'a, F: Float, D: Data<Elem = F>> Predict<ArrayBase<D, Dim<[usize; 1]>>, bool> for Svm<F, bool>
Predict a probability with a feature vector
sourceimpl Predict<ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>, f32> for Svm<f32, f32>
impl Predict<ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>, f32> for Svm<f32, f32>
Predict a probability with a feature vector
sourceimpl Predict<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, f64> for Svm<f64, f64>
impl Predict<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, f64> for Svm<f64, f64>
Predict a probability with a feature vector
sourceimpl<'a> Predict<ArrayBase<ViewRepr<&'a f32>, Dim<[usize; 1]>>, f32> for Svm<f32, f32>
impl<'a> Predict<ArrayBase<ViewRepr<&'a f32>, Dim<[usize; 1]>>, f32> for Svm<f32, f32>
Predict a probability with a feature vector
fn predict(&self, data: ArrayView1<'a, f32>) -> f32
sourceimpl<'a> Predict<ArrayBase<ViewRepr<&'a f64>, Dim<[usize; 1]>>, f64> for Svm<f64, f64>
impl<'a> Predict<ArrayBase<ViewRepr<&'a f64>, Dim<[usize; 1]>>, f64> for Svm<f64, f64>
Predict a probability with a feature vector
fn predict(&self, data: ArrayView1<'a, f64>) -> f64
sourceimpl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<Pr>, Dim<[usize; 1]>>> for Svm<F, Pr>
impl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<Pr>, Dim<[usize; 1]>>> for Svm<F, Pr>
Predict a probability with a feature vector Classify observations
This function takes a number of features and predicts target probabilities that they belong to the positive class.
sourceimpl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<bool>, Dim<[usize; 1]>>> for Svm<F, bool>
impl<F: Float, D: Data<Elem = F>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<bool>, Dim<[usize; 1]>>> for Svm<F, bool>
Classify observations
This function takes a number of features and predicts target probabilities that they belong to the positive class.
sourceimpl<D: Data<Elem = f32>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>> for Svm<f32, f32>
impl<D: Data<Elem = f32>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>> for Svm<f32, f32>
Classify observations
This function takes a number of features and predicts target probabilities that they belong to the positive class.
sourceimpl<D: Data<Elem = f64>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for Svm<f64, f64>
impl<D: Data<Elem = f64>> PredictInplace<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for Svm<f64, f64>
Classify observations
This function takes a number of features and predicts target probabilities that they belong to the positive class.
impl<F: Float, T> StructuralPartialEq for Svm<F, T>
Auto Trait Implementations
impl<F, T> RefUnwindSafe for Svm<F, T> where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<F, T> Send for Svm<F, T> where
T: Send,
impl<F, T> Sync for Svm<F, T> where
T: Sync,
impl<F, T> Unpin for Svm<F, T> where
T: Unpin,
impl<F, T> UnwindSafe for Svm<F, T> where
F: UnwindSafe + RefUnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more