[][src]Struct smartcore::neighbors::knn_regressor::KNNRegressor

pub struct KNNRegressor<T: RealNumber, D: Distance<Vec<T>, T>> { /* fields omitted */ }

K Nearest Neighbors Regressor

Implementations

impl<T: RealNumber, D: Distance<Vec<T>, T>> KNNRegressor<T, D>[src]

pub fn fit<M: Matrix<T>>(
    x: &M,
    y: &M::RowVector,
    parameters: KNNRegressorParameters<T, D>
) -> Result<KNNRegressor<T, D>, Failed>
[src]

Fits KNN regressor to a NxM matrix where N is number of samples and M is number of features.

  • x - training data
  • y - vector with real values
  • parameters - additional parameters like search algorithm and k

pub fn predict<M: Matrix<T>>(&self, x: &M) -> Result<M::RowVector, Failed>[src]

Predict the target for the provided data.

  • x - data of shape NxM where N is number of data points to estimate and M is number of features. Returns a vector of size N with estimates.

Trait Implementations

impl<T: Debug + RealNumber, D: Debug + Distance<Vec<T>, T>> Debug for KNNRegressor<T, D>[src]

impl<'de, T: RealNumber, D: Distance<Vec<T>, T>> Deserialize<'de> for KNNRegressor<T, D> where
    T: Deserialize<'de>,
    D: Deserialize<'de>, 
[src]

impl<T: RealNumber, D: Distance<Vec<T>, T>> PartialEq<KNNRegressor<T, D>> for KNNRegressor<T, D>[src]

impl<T: RealNumber, M: Matrix<T>, D: Distance<Vec<T>, T>> Predictor<M, <M as BaseMatrix<T>>::RowVector> for KNNRegressor<T, D>[src]

impl<T: RealNumber, D: Distance<Vec<T>, T>> Serialize for KNNRegressor<T, D> where
    T: Serialize,
    D: Serialize
[src]

impl<T: RealNumber, M: Matrix<T>, D: Distance<Vec<T>, T>> SupervisedEstimator<M, <M as BaseMatrix<T>>::RowVector, KNNRegressorParameters<T, D>> for KNNRegressor<T, D>[src]

Auto Trait Implementations

impl<T, D> RefUnwindSafe for KNNRegressor<T, D> where
    D: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<T, D> Send for KNNRegressor<T, D> where
    D: Send,
    T: Send
[src]

impl<T, D> Sync for KNNRegressor<T, D> where
    D: Sync,
    T: Sync
[src]

impl<T, D> Unpin for KNNRegressor<T, D> where
    D: Unpin,
    T: Unpin
[src]

impl<T, D> UnwindSafe for KNNRegressor<T, D> where
    D: UnwindSafe,
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,