[−][src]Struct smartcore::neighbors::knn_regressor::KNNRegressor
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]
x: &M,
y: &M::RowVector,
parameters: KNNRegressorParameters<T, D>
) -> Result<KNNRegressor<T, D>, Failed>
Fits KNN regressor to a NxM matrix where N is number of samples and M is number of features.
x
- training datay
- vector with real valuesparameters
- 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]
T: Deserialize<'de>,
D: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T: RealNumber, D: Distance<Vec<T>, T>> PartialEq<KNNRegressor<T, D>> for KNNRegressor<T, D>
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[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]
T: Serialize,
D: Serialize,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, D> Send for KNNRegressor<T, D> where
D: Send,
T: Send,
[src]
D: Send,
T: Send,
impl<T, D> Sync for KNNRegressor<T, D> where
D: Sync,
T: Sync,
[src]
D: Sync,
T: Sync,
impl<T, D> Unpin for KNNRegressor<T, D> where
D: Unpin,
T: Unpin,
[src]
D: Unpin,
T: Unpin,
impl<T, D> UnwindSafe for KNNRegressor<T, D> where
D: UnwindSafe,
T: UnwindSafe,
[src]
D: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,