Expanding Features with Polynomial Terms and Cross Products
Summary
This Python class appends expanded values to a tabular dataset using polynomial bases or feature products. Its available polynomial families are Chebyshev, Legendre, Laguerre, and ordinary powers; the requested degree controls how many orders are generated. A separate product option forms combinations of input features and multiplies their values, creating interaction terms that can represent nonlinear relationships.
The class stores a dataframe with fit and constructs transformed rows when transform is called. It describes a preprocessing technique that could be used to create inputs for statistical or machine-learning models, including models applied to market data. The document provides implementation code but no trading example, validation results, or comparison of methods. It also does not discuss scaling, feature selection, leakage, or the risk that high-degree expansions and large numbers of interactions can increase model complexity and overfitting.
Key ideas
- Polynomial bases can add nonlinear transformations of input features.
- The available bases include Chebyshev, Legendre, Laguerre, and power polynomials.
- Feature crossing adds products of combinations of input variables.
- Expanded features may help model nonlinear patterns but can raise overfitting risk.
- The code gives no market-data example or empirical evidence of predictive value.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.