Basic configuration. You can skip configuration by providing no arguments.
In case no arguments are given you have to use the method fromConfig(...) to set up a configuration in order to use the methods fit(...), transform(...) and fitTransform(...).
Highest order of the monomials
Whether to include only highest order monomials
Whether to disallow higher powers of single features
Saves configuration to a simple option-bag.
The configuration specifies the internal state of PolynomialFeatures completely. Hence the config of the transformer can be used to save it to a file.
Configuration option 'degree'
Configuration option 'homogenous'
Configuration option 'interactionOnly'
Number of input features.
The only configuration option which is set by the fit method.
Throw error in case of invalid configuration.
Sets the number of input features.
Call this method before transform(...). Afterwards the transform(...) method will only accept input with the correct number of features.
Same as applying first fit(...) and then transform(...) to x.
List of features vectors.
Loads configuration from simple option-bag.
Returns the list of polynomial features corresponding to x.
List of features vectors (with same number of features each).
Generated using TypeDoc
Transforms feature vectors to vectors of certain monomials thereof.
E.g. after setting options (degree, homogeneous, interactionOnly), and *fit()*ing, *transform()*s lists of feature vectors like [a, b, c], where a, b and c are numbers, into the following possible outputs
[a^2, ba, ca, a, b^2, cb, b, c^2, c, 1] (degree = 2), that is, all monomials in a, b, c up to degree two.
[a^2, ba, ca, b^2, cb, c^2] (degree = 2, homogeneous = true), that is, all monomials in a, b, c of degree exactly equal to two.
[ab, ac, bc] (degree = 2, homogeneous = true, interactionOnly = true), that is, all monomials in a, b, c of degree exactly equal to two and no feature raised to a power larger than one.
[ab, ac, a, bc, b, c, 1] (degree = 2, homogeneous = false, interactionOnly = true), that is, all monomials in a, b, c of degree at most two and no feature raised to a power larger than one.
Of course, the number of features is not restricted to three, but must be the same in each feature vector of the list to be transformed().