pub struct FunctionTransformer<F: Float> { /* private fields */ }Expand description
A transformer that applies an arbitrary function to the data.
Implements FitTransform so it can be used directly in a Pipeline.
The fit step is a no-op — only the transform function is called.
§Example
ⓘ
use anofox_ml_core::{Pipeline, FunctionTransformer};
let log_transform = FunctionTransformer::new(|x: &Array2<f64>| {
Ok(x.mapv(|v| v.ln()))
});
let pipeline = Pipeline::new()
.push_transformer("log", log_transform);Implementations§
Trait Implementations§
Source§impl<F: Float> Clone for FunctionTransformer<F>
impl<F: Float> Clone for FunctionTransformer<F>
Source§impl<F: Float> Debug for FunctionTransformer<F>
impl<F: Float> Debug for FunctionTransformer<F>
Source§impl<F: Float + 'static> FitUnsupervised<F> for FunctionTransformer<F>
impl<F: Float + 'static> FitUnsupervised<F> for FunctionTransformer<F>
Auto Trait Implementations§
impl<F> !RefUnwindSafe for FunctionTransformer<F>
impl<F> !UnwindSafe for FunctionTransformer<F>
impl<F> Freeze for FunctionTransformer<F>
impl<F> Send for FunctionTransformer<F>
impl<F> Sync for FunctionTransformer<F>
impl<F> Unpin for FunctionTransformer<F>
impl<F> UnsafeUnpin for FunctionTransformer<F>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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