Creating a subset of features identified through feature selection
In the Automatically creating and selecting predictive features from time-series data recipe, we learned how to select relevant features using tsfresh
. We also discussed the limitations of tsfresh
’s selection procedures and suggested following up with alternative feature selection methods to identify predictive features while avoiding redundancy.
In this recipe, we will create and select features using tsfresh
. Following that, we will reduce the feature space further by utilizing Lasso regularization. Then, we will learn how to create a dictionary from the selected feature names to trigger the creation of those features only from future time series.
How to do it...
Let’s begin by importing the necessary libraries and getting the dataset ready:
- Let’s import the required libraries and functions:
import pandas as pd from sklearn.feature_selection import SelectFromModel from sklearn...