Polynomial Features¶
Generate a new feature matrix consisting of all polynomial combinations of the features with less than a given degree
Documentation
Generate a new feature matrix consisting of all polynomial combinations of the features with less than a given degree
Configuration:
degree
If a single int is given, it specifies the maximal degree of the polynomial features. If a tuple (min_degree, max_degree) is passed, then min_degree is the minimum and max_degree is the maximum polynomial degree of the generated features. Note that min_degree=0 and min_degree=1 are equivalent as outputting the degree zero term is determined by include_bias.
interaction_only
If True, only interaction features are produced: features that are products of at most degree distinct input features, i.e. terms with power of 2 or higher of the same input feature are excluded:
included: x, x, x * x, etc.
excluded: x ** 2, x ** 2 * x, etc.
include_bias
If True (default), then include a bias column, the feature in which all polynomial powers are zero (i.e. a column of ones - acts as an intercept term in a linear model).
Attributes:
n_input_features_
n_output_features_
powers_
Input ports:
- Output ports:
- modelmodel
Model
Definition
Input ports
Output ports
- model
model
Model
- class node_preprocessing.PolynomialFeatures[source]