pub struct NystroemFeatures { /* private fields */ }Expand description
Nystroem approximation as random features.
Represents kernel approximation using Nystroem method, which uses a subset of training points as landmarks.
Implementations§
Source§impl NystroemFeatures
impl NystroemFeatures
Sourcepub fn new(landmarks: Vec<Vec<f64>>, kernel_type: KernelType) -> Result<Self>
pub fn new(landmarks: Vec<Vec<f64>>, kernel_type: KernelType) -> Result<Self>
Create Nystroem features from landmark points.
§Arguments
landmarks- Subset of training points to use as landmarkskernel_type- The kernel to approximate
Sourcepub fn transform(&self, x: &[f64]) -> Result<Vec<f64>>
pub fn transform(&self, x: &[f64]) -> Result<Vec<f64>>
Transform a single input vector to Nystroem features.
Sourcepub fn transform_batch(&self, data: &[Vec<f64>]) -> Result<Vec<Vec<f64>>>
pub fn transform_batch(&self, data: &[Vec<f64>]) -> Result<Vec<Vec<f64>>>
Transform multiple input vectors.
Sourcepub fn n_landmarks(&self) -> usize
pub fn n_landmarks(&self) -> usize
Get the number of landmarks (output dimension).
Trait Implementations§
Source§impl Clone for NystroemFeatures
impl Clone for NystroemFeatures
Source§fn clone(&self) -> NystroemFeatures
fn clone(&self) -> NystroemFeatures
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NystroemFeatures
impl RefUnwindSafe for NystroemFeatures
impl Send for NystroemFeatures
impl Sync for NystroemFeatures
impl Unpin for NystroemFeatures
impl UnwindSafe for NystroemFeatures
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more