sega_learn.utils.polynomialTransform

# Importing the required libraries

 
Modules
       
numpy

 
Classes
       
builtins.object
PolynomialTransform

 
class PolynomialTransform(builtins.object)
    PolynomialTransform(degree=2)
 
Implements Polynomial Feature Transformation.
 
Polynomial feature transformation creates new features by raising existing features to a power or creating interaction terms.
 
Args:
    degree (int): The degree of the polynomial features (default is 2).
 
Attributes:
    n_samples (int): The number of samples in the input data.
    n_features (int): The number of features in the input data.
    n_output_features (int): The number of output features after transformation.
    combinations (list of tuples): The combinations of features for polynomial terms.
 
  Methods defined here:
__init__(self, degree=2)
Initialize the PolynomialTransform object.
fit(self, X)
Fit the model to the data.
 
Uses itertools.combinations_with_replacement to generate all possible combinations of features(X) of degree n.
fit_transform(self, X)
Fit to data, then transform it.
transform(self, X)
Transform the data into polynomial features by computing the product of the features for each combination of features.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object