Struct linfa_svm::Svm [−][src]
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
impl<F: Float, T> Svm<F, T>
[src]
impl<F: Float, T> Svm<F, T>
[src]pub fn params() -> SvmParams<F, T>
[src]
Create hyper parameter set
This creates a SvmParams
and sets it to the default values:
- C values of (1, 1)
- Eps of 1e-7
- No shrinking
- Linear kernel
pub fn nsupport(&self) -> usize
[src]
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.
pub fn weighted_sum<D: Data<Elem = F>>(&self, sample: &ArrayBase<D, Ix1>) -> F
[src]
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
impl<'a, F: Float, T> Display for Svm<F, T>
[src]
impl<'a, F: Float, T> Display for Svm<F, T>
[src]Display solution
In order to understand the solution of the SMO solver the objective, number of iterations and required support vectors are printed here.
impl<F: Float, D: Data<Elem = F>> Predict<ArrayBase<D, Dim<[usize; 1]>>, Pr> for Svm<F, Pr>
[src]
impl<F: Float, D: Data<Elem = F>> Predict<ArrayBase<D, Dim<[usize; 1]>>, Pr> for Svm<F, Pr>
[src]Predict a probability with a feature vector
impl<'a, F: Float, D: Data<Elem = F>> Predict<ArrayBase<D, Dim<[usize; 1]>>, bool> for Svm<F, bool>
[src]
impl<'a, F: Float, D: Data<Elem = F>> Predict<ArrayBase<D, Dim<[usize; 1]>>, bool> for Svm<F, bool>
[src]Predict a probability with a feature vector
impl Predict<ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>, f32> for Svm<f32, f32>
[src]
impl Predict<ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>, f32> for Svm<f32, f32>
[src]Predict a probability with a feature vector
impl Predict<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, f64> for Svm<f64, f64>
[src]
impl Predict<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>, f64> for Svm<f64, f64>
[src]Predict a probability with a feature vector
impl<'a> Predict<ArrayBase<ViewRepr<&'a f32>, Dim<[usize; 1]>>, f32> for Svm<f32, f32>
[src]
impl<'a> Predict<ArrayBase<ViewRepr<&'a f32>, Dim<[usize; 1]>>, f32> for Svm<f32, f32>
[src]Predict a probability with a feature vector
fn predict(&self, data: ArrayView1<'a, f32>) -> f32
[src]
impl<'a> Predict<ArrayBase<ViewRepr<&'a f64>, Dim<[usize; 1]>>, f64> for Svm<f64, f64>
[src]
impl<'a> Predict<ArrayBase<ViewRepr<&'a f64>, Dim<[usize; 1]>>, f64> for Svm<f64, f64>
[src]Predict a probability with a feature vector
fn predict(&self, data: ArrayView1<'a, f64>) -> f64
[src]
impl<F: Float, D: Data<Elem = F>> PredictRef<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<Pr>, Dim<[usize; 1]>>> for Svm<F, Pr>
[src]
impl<F: Float, D: Data<Elem = F>> PredictRef<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<Pr>, Dim<[usize; 1]>>> for Svm<F, Pr>
[src]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.
impl<F: Float, D: Data<Elem = F>> PredictRef<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<bool>, Dim<[usize; 1]>>> for Svm<F, bool>
[src]
impl<F: Float, D: Data<Elem = F>> PredictRef<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<bool>, Dim<[usize; 1]>>> for Svm<F, bool>
[src]Classify observations
This function takes a number of features and predicts target probabilities that they belong to the positive class.
impl<D: Data<Elem = f32>> PredictRef<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>> for Svm<f32, f32>
[src]
impl<D: Data<Elem = f32>> PredictRef<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f32>, Dim<[usize; 1]>>> for Svm<f32, f32>
[src]Classify observations
This function takes a number of features and predicts target probabilities that they belong to the positive class.
Auto Trait Implementations
impl<F, T> RefUnwindSafe for Svm<F, T> where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<F, T> RefUnwindSafe for Svm<F, T> where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<F, T> UnwindSafe for Svm<F, T> where
F: RefUnwindSafe + UnwindSafe,
T: UnwindSafe,
impl<F, T> UnwindSafe for Svm<F, T> where
F: RefUnwindSafe + UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<'a, F, D, T, O> Predict<&'a ArrayBase<D, Dim<[usize; 2]>>, T> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
[src]
impl<'a, F, D, T, O> Predict<&'a ArrayBase<D, Dim<[usize; 2]>>, T> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
[src]impl<'a, F, R, T, S, O> Predict<&'a DatasetBase<R, T>, S> for O where
F: Float,
O: PredictRef<R, S>,
R: Records<Elem = F>,
[src]
impl<'a, F, R, T, S, O> Predict<&'a DatasetBase<R, T>, S> for O where
F: Float,
O: PredictRef<R, S>,
R: Records<Elem = F>,
[src]pub fn predict(&self, ds: &'a DatasetBase<R, T>) -> S
[src]
impl<F, D, T, O> Predict<ArrayBase<D, Dim<[usize; 2]>>, DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
[src]
impl<F, D, T, O> Predict<ArrayBase<D, Dim<[usize; 2]>>, DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
[src]impl<F, R, T, S, O> Predict<DatasetBase<R, T>, DatasetBase<R, S>> for O where
F: Float,
O: PredictRef<R, S>,
R: Records<Elem = F>,
[src]
impl<F, R, T, S, O> Predict<DatasetBase<R, T>, DatasetBase<R, S>> for O where
F: Float,
O: PredictRef<R, S>,
R: Records<Elem = F>,
[src]pub fn predict(&self, ds: DatasetBase<R, T>) -> DatasetBase<R, S>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,