pub struct SplineBasisFunctions { /* private fields */ }Expand description
Spline Basis Functions Generator
Generate spline basis functions for non-linear feature transformation. Supports B-splines and Natural Cubic Splines for smooth curve fitting and feature engineering applications.
§Parameters
n_splines- Number of spline basis functions to generatedegree- Degree of the spline (1 for linear, 2 for quadratic, 3 for cubic)spline_type- Type of spline (B-spline or Natural Cubic)knots- Knot positions (if None, uniformly distributed knots are used)extrapolation- How to handle values outside the knot range
§Examples
use sklears_feature_extraction::basic_features::{SplineBasisFunctions, SplineType};
use scirs2_core::ndarray::array;
let X = array![[0.0], [0.25], [0.5], [0.75], [1.0]];
let spline = SplineBasisFunctions::new()
.n_splines(5)
.degree(3)
.spline_type(SplineType::BSpline);
let features = spline.transform(&X.view()).expect("valid input produces transform output");Implementations§
Source§impl SplineBasisFunctions
impl SplineBasisFunctions
Sourcepub fn spline_type(self, spline_type: SplineType) -> Self
pub fn spline_type(self, spline_type: SplineType) -> Self
Set the type of spline
Sourcepub fn extrapolation(self, extrapolation: ExtrapolationMode) -> Self
pub fn extrapolation(self, extrapolation: ExtrapolationMode) -> Self
Set extrapolation mode
Trait Implementations§
Source§impl Clone for SplineBasisFunctions
impl Clone for SplineBasisFunctions
Source§impl Debug for SplineBasisFunctions
impl Debug for SplineBasisFunctions
Source§impl Default for SplineBasisFunctions
impl Default for SplineBasisFunctions
Auto Trait Implementations§
impl Freeze for SplineBasisFunctions
impl RefUnwindSafe for SplineBasisFunctions
impl Send for SplineBasisFunctions
impl Sync for SplineBasisFunctions
impl Unpin for SplineBasisFunctions
impl UnsafeUnpin for SplineBasisFunctions
impl UnwindSafe for SplineBasisFunctions
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