pub struct PolynomialFeatures {
pub degree: usize,
pub interaction_only: bool,
pub include_bias: bool,
/* private fields */
}Expand description
Polynomial-feature expansion.
See the module docs for the column ordering and complexity.
Fields§
§degree: usizeTotal polynomial degree.
interaction_only: boolIf true, only produce monomials in which every exponent is 0
or 1 (no x_j² etc.).
include_bias: boolIf true, prepend the all-ones bias column.
Implementations§
Source§impl PolynomialFeatures
impl PolynomialFeatures
Sourcepub fn new(degree: usize) -> Self
pub fn new(degree: usize) -> Self
New expansion at the given degree (include_bias = true,
interaction_only = false).
Sourcepub fn interaction_only(self, flag: bool) -> Self
pub fn interaction_only(self, flag: bool) -> Self
Set interaction_only.
Sourcepub fn include_bias(self, flag: bool) -> Self
pub fn include_bias(self, flag: bool) -> Self
Set include_bias.
Sourcepub fn output_columns(&self, d: usize) -> usize
pub fn output_columns(&self, d: usize) -> usize
Number of output columns for a d-column input.
Sourcepub fn fit_transform(&self, x: ArrayView2<'_, f64>) -> Result<Array2<f64>>
pub fn fit_transform(&self, x: ArrayView2<'_, f64>) -> Result<Array2<f64>>
One-call fit + transform.
Trait Implementations§
Source§impl Clone for PolynomialFeatures
impl Clone for PolynomialFeatures
Source§impl Debug for PolynomialFeatures
impl Debug for PolynomialFeatures
Source§impl PartialEq for PolynomialFeatures
impl PartialEq for PolynomialFeatures
impl StructuralPartialEq for PolynomialFeatures
Auto Trait Implementations§
impl Freeze for PolynomialFeatures
impl RefUnwindSafe for PolynomialFeatures
impl Send for PolynomialFeatures
impl Sync for PolynomialFeatures
impl Unpin for PolynomialFeatures
impl UnsafeUnpin 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