arbitragelab.ml_approach.feature_expander
This module implements the Feature Expansion class.
Module Contents
Classes
Higher-order term Feature Expander implementation. The implementation consists |
- class FeatureExpander(methods: list = [], n_orders: int = 1)
Higher-order term Feature Expander implementation. The implementation consists of two major parts. The first part consists of using a collection of orthogonal polynomials’ coefficients, ordered from lowest order term to highest. The implemented series are [‘chebyshev’, ‘legendre’, ‘laguerre’, ‘power’] polynomials. The second part is a combinatorial version of feature crossing, which involves the generation of feature collections of the n order and multiplying them together. This can be used by adding [‘product’] in the ‘methods’ parameter in the constructor.
- fit(frame: pandas.DataFrame)
Stores the dataset inside the class object.
- Parameters:
frame – (pd.DataFrame) Dataset to store.
- transform() pandas.DataFrame
Returns the original dataframe with features requested from the ‘methods’ parameter in the constructor.
- Returns:
(pd.DataFrame) Original DataFrame with the expanded values appended to it.