pub struct FunctionTransformer {
pub func: Box<dyn Fn(ArrayView2<'_, f64>) -> Result<Array2<f64>>>,
pub inverse_func: Option<Box<dyn Fn(ArrayView2<'_, f64>) -> Result<Array2<f64>>>>,
pub n_features_in: usize,
pub validate: bool,
}Expand description
Fitted FunctionTransformer.
Fields§
§func: Box<dyn Fn(ArrayView2<'_, f64>) -> Result<Array2<f64>>>Forward function f(x) → x'.
inverse_func: Option<Box<dyn Fn(ArrayView2<'_, f64>) -> Result<Array2<f64>>>>Optional inverse function f⁻¹(x') → x.
n_features_in: usizeColumn count seen at fit.
validate: boolWhether to check that transform preserves column count.
Implementations§
Source§impl FunctionTransformer
impl FunctionTransformer
Sourcepub fn fit(
x: ArrayView2<'_, f64>,
func: Box<dyn Fn(ArrayView2<'_, f64>) -> Result<Array2<f64>>>,
inverse_func: Option<Box<dyn Fn(ArrayView2<'_, f64>) -> Result<Array2<f64>>>>,
) -> Result<Self>
pub fn fit( x: ArrayView2<'_, f64>, func: Box<dyn Fn(ArrayView2<'_, f64>) -> Result<Array2<f64>>>, inverse_func: Option<Box<dyn Fn(ArrayView2<'_, f64>) -> Result<Array2<f64>>>>, ) -> Result<Self>
Fit — just captures the expected column count.
Sourcepub fn inverse_transform(&self, x: ArrayView2<'_, f64>) -> Result<Array2<f64>>
pub fn inverse_transform(&self, x: ArrayView2<'_, f64>) -> Result<Array2<f64>>
Inverse-transform if an inverse was provided.
Auto Trait Implementations§
impl !RefUnwindSafe for FunctionTransformer
impl !Send for FunctionTransformer
impl !Sync for FunctionTransformer
impl !UnwindSafe for FunctionTransformer
impl Freeze for FunctionTransformer
impl Unpin for FunctionTransformer
impl UnsafeUnpin for FunctionTransformer
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