pub struct PolynomialFeatures { /* private fields */ }Expand description
Polynomial feature generator
Generates polynomial and interaction features from input data. For example, with degree=2 and features [a, b], generates: [1, a, b, a², ab, b²]
Implementations§
Source§impl PolynomialFeatures
impl PolynomialFeatures
Sourcepub fn new(
degree: usize,
include_bias: bool,
interaction_only: bool,
) -> UtilsResult<Self>
pub fn new( degree: usize, include_bias: bool, interaction_only: bool, ) -> UtilsResult<Self>
Create a new polynomial feature generator
§Arguments
degree- Maximum degree of polynomial featuresinclude_bias- Whether to include a bias column (constant 1.0)interaction_only- If true, only interaction features (no powers of single features)
Sourcepub fn n_output_features(&self, n_features: usize) -> usize
pub fn n_output_features(&self, n_features: usize) -> usize
Trait Implementations§
Source§impl Clone for PolynomialFeatures
impl Clone for PolynomialFeatures
Source§fn clone(&self) -> PolynomialFeatures
fn clone(&self) -> PolynomialFeatures
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 PolynomialFeatures
impl RefUnwindSafe for PolynomialFeatures
impl Send for PolynomialFeatures
impl Sync for PolynomialFeatures
impl Unpin for PolynomialFeatures
impl UnwindSafe for PolynomialFeatures
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