Nasdaq Index Prediction and Investment Simulation

Math 178 Final Project

Abstract

Dataset: Nasdaq Index

The dataset is from UCI Machine Learning Repository.

Link: https://archive.ics.uci.edu/dataset/554/cnnpred+cnn+based+stock+market+prediction+using+a+diverse+set+of+variables

“This dataset contains several daily features of S&P 500, NASDAQ Composite, Dow Jones Industrial Average, RUSSELL 2000, and NYSE Composite from 2010 to 2017……It covers features from various categories of technical indicators, futures contracts, price of commodities, important indices of markets around the world, price of major companies in the U.S. market, and treasury bill rates.” [1]

For this project, we only use the “NASDAQ Composite” part of this dataset.

Objectives

The goal of this project is predicting the future Nasdaq Composite Index (COMP) using historical data by machine learning and deep learning models.

Particularly, we have two goals:

  1. Predicting the value of Nasdaq Index of the next day given historical data.
  2. Conducting an investment simulation by predicting increasing or decreasing trend of Nasdaq Index of the next day.

Methods

First, we cleaned the data, did basic feature engineering, implemented exploratory data visulization, and made baseline models in section 1. Then, we used a variety of regression models to try to predict the values of future Nasdaq Index, respectively. Also, we implemented some feature selection methods and optimized the hyperparameters to improve the performance of the models.

  • Regression Models (Section 2-4): Linear Regression, Tree Based Models (Decision Tree, Random Forest, XGBoost), MLP, LSTM, 1DCNN, CNN LSTM
  • Feature Selection Method: Recursive Feature Elimination (RFE)

Finally, in section 5, we evaluated and compared the accuracy of the different models on the testing data and implement an investment simulation to evaluate the profitabilities of these models.

Results

Because the noise of data is high and the test data is deviated from the training data, it is very hard to make precise predictions. The performance of all the models we trained are not very good, which are even worse than the baseline model. This result is expected. It reflects the complexity of the financial market. More advanced model and more significant features might be helpful to improve the prediction.

1. Data Preparation

1.1 Exploratory data analysis and data preprocessing

# Import the necessary libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import altair as alt
import joblib
from umap.umap_ import UMAP
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import mean_squared_error
from sklearn.feature_selection import RFECV
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import TimeSeriesSplit
from sklearn.linear_model import LinearRegression
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import RandomForestRegressor
from xgboost import XGBRegressor
from tensorflow.keras.models import Sequential, load_model
from tensorflow.keras.layers import Dense, Dropout, LSTM, Conv1D, Flatten, MaxPooling1D
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks import ReduceLROnPlateau, EarlyStopping

Firstly, we take a look at the columns and the dataset.

# Load the dataset.
FILE_PATH = "Processed_NASDAQ.csv"
df = pd.read_csv(FILE_PATH)

# Display the data.
print(df)
            Date        Close    Volume       mom      mom1      mom2  \
0     2009-12-31  2269.149902       NaN       NaN       NaN       NaN   
1     2010-01-04  2308.419922  0.560308  0.017306       NaN       NaN   
2     2010-01-05  2308.709961  0.225994  0.000126  0.017306       NaN   
3     2010-01-06  2301.090088 -0.048364 -0.003300  0.000126  0.017306   
4     2010-01-07  2300.050049  0.007416 -0.000452 -0.003300  0.000126   
...          ...          ...       ...       ...       ...       ...   
1979  2017-11-09  6750.049805  0.058830 -0.005755  0.003153 -0.002750   
1980  2017-11-10  6750.939941 -0.116863  0.000132 -0.005755  0.003153   
1981  2017-11-13  6757.600098 -0.000091  0.000987  0.000132 -0.005755   
1982  2017-11-14  6737.870117  0.005087 -0.002920  0.000987  0.000132   
1983  2017-11-15  6706.209961 -0.037891 -0.004699 -0.002920  0.000987   

          mom3     ROC_5    ROC_10    ROC_15  ...   NZD  silver-F  RUSSELL-F  \
0          NaN       NaN       NaN       NaN  ...  0.03      0.26      -1.08   
1          NaN       NaN       NaN       NaN  ...  1.52      3.26       1.61   
2          NaN       NaN       NaN       NaN  ... -0.07      1.96      -0.20   
3          NaN       NaN       NaN       NaN  ...  0.56      2.15      -0.02   
4     0.017306       NaN       NaN       NaN  ... -0.72      0.94       0.50   
...        ...       ...       ...       ...  ...   ...       ...        ...   
1979  0.003252  0.522862  2.947790  2.194980  ... -0.24     -0.62      -0.34   
1980 -0.002750 -0.199573  0.741356  1.838727  ... -0.27     -0.58      -0.20   
1981  0.003153 -0.424963  0.875362  2.592598  ... -0.38      0.72      -0.04   
1982 -0.005755 -0.441942  0.151616  2.113229  ... -0.39      0.17      -0.21   
1983  0.000132 -1.221221 -0.153648  2.168224  ...  0.03     -0.60      -0.46   

      S&P-F   CHF  Dollar index-F  Dollar index  wheat-F   XAG   XAU  
0     -1.00 -0.11           -0.08         -0.06    -0.48  0.30  0.39  
1      1.62 -0.57           -0.59         -0.42     3.12  3.91  2.10  
2      0.31  0.43            0.03          0.12    -0.90  1.42 -0.12  
3      0.07 -0.56           -0.24         -0.17     2.62  2.25  1.77  
4      0.40  0.58            0.58          0.54    -1.85  0.22 -0.58  
...     ...   ...             ...           ...      ...   ...   ...  
1979  -0.27 -0.61           -0.44         -0.45     0.53 -0.26  0.32  
1980  -0.17  0.18           -0.07         -0.05     0.70 -0.71 -0.80  
1981   0.10  0.06            0.12          0.11    -1.85  0.83  0.16  
1982  -0.15 -0.70           -0.71         -0.70     1.00  0.01  0.24  
1983  -0.50 -0.11            0.01         -0.02    -2.04 -0.22 -0.11  

[1984 rows x 84 columns]
df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1984 entries, 0 to 1983
Data columns (total 84 columns):
 #   Column          Non-Null Count  Dtype  
---  ------          --------------  -----  
 0   Date            1984 non-null   object 
 1   Close           1984 non-null   float64
 2   Volume          1983 non-null   float64
 3   mom             1983 non-null   float64
 4   mom1            1982 non-null   float64
 5   mom2            1981 non-null   float64
 6   mom3            1980 non-null   float64
 7   ROC_5           1979 non-null   float64
 8   ROC_10          1974 non-null   float64
 9   ROC_15          1969 non-null   float64
 10  ROC_20          1964 non-null   float64
 11  EMA_10          1975 non-null   float64
 12  EMA_20          1965 non-null   float64
 13  EMA_50          1935 non-null   float64
 14  EMA_200         1785 non-null   float64
 15  DTB4WK          1984 non-null   float64
 16  DTB3            1984 non-null   float64
 17  DTB6            1984 non-null   float64
 18  DGS5            1984 non-null   float64
 19  DGS10           1984 non-null   float64
 20  Oil             1983 non-null   float64
 21  Gold            1983 non-null   float64
 22  DAAA            1984 non-null   float64
 23  DBAA            1984 non-null   float64
 24  GBP             1506 non-null   float64
 25  JPY             1505 non-null   float64
 26  CAD             1501 non-null   float64
 27  CNY             1505 non-null   float64
 28  AAPL            1983 non-null   float64
 29  AMZN            1983 non-null   float64
 30  GE              1983 non-null   float64
 31  JNJ             1983 non-null   float64
 32  JPM             1983 non-null   float64
 33  MSFT            1983 non-null   float64
 34  WFC             1983 non-null   float64
 35  XOM             1983 non-null   float64
 36  FCHI            1944 non-null   float64
 37  FTSE            1913 non-null   float64
 38  GDAXI           1917 non-null   float64
 39  GSPC            1983 non-null   float64
 40  HSI             1814 non-null   float64
 41  DJI             1983 non-null   float64
 42  SSEC            1746 non-null   float64
 43  RUT             1983 non-null   float64
 44  NYSE            1983 non-null   float64
 45  TE1             1984 non-null   float64
 46  TE2             1984 non-null   float64
 47  TE3             1984 non-null   float64
 48  TE5             1984 non-null   float64
 49  TE6             1984 non-null   float64
 50  DE1             1984 non-null   float64
 51  DE2             1984 non-null   float64
 52  DE4             1984 non-null   float64
 53  DE5             1984 non-null   float64
 54  DE6             1984 non-null   float64
 55  CTB3M           1983 non-null   float64
 56  CTB6M           1983 non-null   float64
 57  CTB1Y           1983 non-null   float64
 58  Name            1984 non-null   object 
 59  AUD             1984 non-null   float64
 60  Brent           1984 non-null   float64
 61  CAC-F           1980 non-null   float64
 62  copper-F        1984 non-null   float64
 63  WIT-oil         1984 non-null   float64
 64  DAX-F           1980 non-null   float64
 65  DJI-F           1984 non-null   float64
 66  EUR             1984 non-null   float64
 67  FTSE-F          1978 non-null   float64
 68  gold-F          1984 non-null   float64
 69  HSI-F           1909 non-null   float64
 70  KOSPI-F         1905 non-null   float64
 71  NASDAQ-F        1984 non-null   float64
 72  GAS-F           1984 non-null   float64
 73  Nikkei-F        1984 non-null   float64
 74  NZD             1984 non-null   float64
 75  silver-F        1984 non-null   float64
 76  RUSSELL-F       1984 non-null   float64
 77  S&P-F           1984 non-null   float64
 78  CHF             1984 non-null   float64
 79  Dollar index-F  1984 non-null   float64
 80  Dollar index    1984 non-null   float64
 81  wheat-F         1982 non-null   float64
 82  XAG             1984 non-null   float64
 83  XAU             1984 non-null   float64
dtypes: float64(82), object(2)
memory usage: 1.3+ MB

As we can see, there are a lot of null values. We try to fill these null values to keep as many samples as possible. Considering the nature of time-series prediction, it is important to avoid leaking the future data when we fill these values. So, we don’t choose the methods filling backward or filling the mean values which involves using future values to fill the past. Instead, we utilize approaches including filling forward and dropping null values.

# EMA_200 contains too many null values.
# Dropping these rows would lose a lot of data, and filling them could distort the data pattern.
# Therefore, we choose to drop this feature.
df = df.drop(columns=['EMA_200'], errors='ignore')

# Fill forward missing values and then drop any remaining null values.
df = df.ffill()
df = df.dropna()

print(df)
            Date        Close    Volume       mom      mom1      mom2  \
49    2010-03-15  2362.209961 -0.067949 -0.002302 -0.000338  0.004031   
50    2010-03-16  2378.010010  0.125608  0.006689 -0.002302 -0.000338   
51    2010-03-17  2389.090088  0.036119  0.004659  0.006689 -0.002302   
52    2010-03-18  2391.280029 -0.047493  0.000917  0.004659  0.006689   
53    2010-03-19  2374.409912  0.406201 -0.007055  0.000917  0.004659   
...          ...          ...       ...       ...       ...       ...   
1979  2017-11-09  6750.049805  0.058830 -0.005755  0.003153 -0.002750   
1980  2017-11-10  6750.939941 -0.116863  0.000132 -0.005755  0.003153   
1981  2017-11-13  6757.600098 -0.000091  0.000987  0.000132 -0.005755   
1982  2017-11-14  6737.870117  0.005087 -0.002920  0.000987  0.000132   
1983  2017-11-15  6706.209961 -0.037891 -0.004699 -0.002920  0.000987   

          mom3     ROC_5    ROC_10    ROC_15  ...   NZD  silver-F  RUSSELL-F  \
49    0.007805  1.286334  3.898710  5.360318  ...  0.14     -0.47      -0.27   
50    0.004031  1.594839  4.262557  7.435037  ...  1.35      1.46       0.77   
51   -0.000338  1.277693  4.753414  6.851388  ...  0.21      0.98       0.49   
52   -0.002302  0.963498  4.317477  7.029749  ...  0.18     -0.54      -0.28   
53    0.006689  0.285092  2.065889  6.082846  ... -0.95     -2.24       0.54   
...        ...       ...       ...       ...  ...   ...       ...        ...   
1979  0.003252  0.522862  2.947790  2.194980  ... -0.24     -0.62      -0.34   
1980 -0.002750 -0.199573  0.741356  1.838727  ... -0.27     -0.58      -0.20   
1981  0.003153 -0.424963  0.875362  2.592598  ... -0.38      0.72      -0.04   
1982 -0.005755 -0.441942  0.151616  2.113229  ... -0.39      0.17      -0.21   
1983  0.000132 -1.221221 -0.153648  2.168224  ...  0.03     -0.60      -0.46   

      S&P-F   CHF  Dollar index-F  Dollar index  wheat-F   XAG   XAU  
49    -0.09  0.39            0.41          0.53    -1.34 -0.06  0.60  
50     0.80 -0.62           -0.21         -0.62     1.83  2.11  1.50  
51     0.54 -0.09           -0.19         -0.14     1.74  0.40 -0.06  
52     0.02  0.30            0.74          0.73    -1.31 -0.69  0.08  
53     0.60  0.38            0.66          0.62    -0.95 -2.36 -1.63  
...     ...   ...             ...           ...      ...   ...   ...  
1979  -0.27 -0.61           -0.44         -0.45     0.53 -0.26  0.32  
1980  -0.17  0.18           -0.07         -0.05     0.70 -0.71 -0.80  
1981   0.10  0.06            0.12          0.11    -1.85  0.83  0.16  
1982  -0.15 -0.70           -0.71         -0.70     1.00  0.01  0.24  
1983  -0.50 -0.11            0.01         -0.02    -2.04 -0.22 -0.11  

[1935 rows x 83 columns]

Feature Processing and Feature Expansion

  1. Create three date-related features.
  2. The ‘Close’ (Nasdaq Composite Index) and ‘EMA’ (Exponential Moving Average) features are numerical values, but most of the other features are rate of change (ROC). It doesn’t make sense to use ROC to predict a numerical value, especially for linear models. (For example, from 5000 to 6000, the ROC is 0.2. From 1000 to 2000, the ROC is 1.) Therefore, we converge the ‘Close’ and ‘EMA’ features to rate of change.
  3. We insert the t-1 to t-k days data to every t day’s row by creating new columns.
  4. Sqaure all the features to create new features to enhance non-linearity capture and highlight volatility effects.
import pandas as pd

# Convert the 'Date' column to datetime format.
df['Date'] = pd.to_datetime(df['Date'])

# Create new features:
# 1. Day of the week (Monday=0, Sunday=6)
df['day_of_week'] = df['Date'].dt.dayofweek

# 2. Day of the month
df['day_of_month'] = df['Date'].dt.day

# 3. Month as a number
df['month'] = df['Date'].dt.month

# Compute the rate of change (as a decimal, not a percentage)
df['Close_ROC'] = df['Close'].pct_change()
df['EMA10_ROC'] = df['EMA_10'].pct_change()
df['EMA20_ROC'] = df['EMA_20'].pct_change()
df['EMA50_ROC'] = df['EMA_50'].pct_change()

# Save a copy of the original DataFrame.
df_raw = df.copy()

# Drop non-numeric columns.
df = df.drop(columns=['Date', 'Name'], errors='ignore')

# Drop the first row because the rate of change doesn't apply to it.
df = df.dropna()

# Save the list of original columns (before adding lag features).
original_cols = df.columns.tolist()

# Number of previous days to include.
k = 5

# For each lag (from 1 to k), create new columns by shifting the original columns and
# create squared features for each lagged column.
for i in range(1, k + 1):
    for col in original_cols:
        lagged_col = f'{col}_day-{i}'
        squared_col = f'{lagged_col}^2'
        df[lagged_col] = df[col].shift(i)
        df[squared_col] = df[lagged_col] ** 2

# Drop rows with NaN values resulting from shifting.
df = df.dropna()

print(df)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
            Close    Volume       mom      mom1      mom2      mom3     ROC_5  \
55    2415.239990  0.006985  0.008283  0.008840 -0.007055  0.000917  1.565594   
56    2398.760010 -0.011816 -0.006823  0.008283  0.008840 -0.007055  0.404753   
57    2397.409912  0.110328 -0.000563 -0.006823  0.008283  0.008840  0.256343   
58    2395.129883 -0.124568 -0.000951 -0.000563 -0.006823  0.008283  0.872637   
59    2404.360107 -0.168958  0.003854 -0.000951 -0.000563 -0.006823  0.374059   
...           ...       ...       ...       ...       ...       ...       ...   
1979  6750.049805  0.058830 -0.005755  0.003153 -0.002750  0.003252  0.522862   
1980  6750.939941 -0.116863  0.000132 -0.005755  0.003153 -0.002750 -0.199573   
1981  6757.600098 -0.000091  0.000987  0.000132 -0.005755  0.003153 -0.424963   
1982  6737.870117  0.005087 -0.002920  0.000987  0.000132 -0.005755 -0.441942   
1983  6706.209961 -0.037891 -0.004699 -0.002920  0.000987  0.000132 -1.221221   

        ROC_10    ROC_15    ROC_20  ...  month_day-5  month_day-5^2  \
55    3.185402  5.894885  9.117033  ...          3.0            9.0   
56    1.687618  5.177407  7.283873  ...          3.0            9.0   
57    1.222311  4.584888  7.304113  ...          3.0            9.0   
58    1.160216  2.956553  7.008563  ...          3.0            9.0   
59    1.784352  3.093639  5.752628  ...          3.0            9.0   
...        ...       ...       ...  ...          ...            ...   
1979  2.947790  2.194980  2.405216  ...         11.0          121.0   
1980  0.741356  1.838727  2.197162  ...         11.0          121.0   
1981  0.875362  2.592598  2.016910  ...         11.0          121.0   
1982  0.151616  2.113229  1.724273  ...         11.0          121.0   
1983 -0.153648  2.168224  1.237727  ...         11.0          121.0   

      Close_ROC_day-5  Close_ROC_day-5^2  EMA10_ROC_day-5  EMA10_ROC_day-5^2  \
55           0.006689       4.473834e-05         0.003607           0.000013   
56           0.004659       2.170992e-05         0.003802           0.000014   
57           0.000917       8.402331e-07         0.003268           0.000011   
58          -0.007055       4.977088e-05         0.001364           0.000002   
59           0.008840       7.814714e-05         0.002731           0.000007   
...               ...                ...              ...                ...   
1979        -0.000237       5.602981e-08         0.001613           0.000003   
1980         0.007372       5.434081e-05         0.002668           0.000007   
1981         0.003252       1.057747e-05         0.002775           0.000008   
1982        -0.002750       7.560430e-06         0.001758           0.000003   
1983         0.003153       9.942828e-06         0.002014           0.000004   

      EMA20_ROC_day-5  EMA20_ROC_day-5^2  EMA50_ROC_day-5  EMA50_ROC_day-5^2  
55           0.003339           0.000011         0.002181           0.000005  
56           0.003468           0.000012         0.002284           0.000005  
57           0.003217           0.000010         0.002227           0.000005  
58           0.002209           0.000005         0.001843           0.000003  
59           0.002854           0.000008         0.002130           0.000005  
...               ...                ...              ...                ...  
1979         0.001461           0.000002         0.001191           0.000001  
1980         0.002031           0.000004         0.001441           0.000002  
1981         0.002150           0.000005         0.001514           0.000002  
1982         0.001674           0.000003         0.001341           0.000002  
1983         0.001817           0.000003         0.001414           0.000002  

[1929 rows x 968 columns]
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:43: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[lagged_col] = df[col].shift(i)
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3073063491.py:44: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`
  df[squared_col] = df[lagged_col] ** 2
df
Close Volume mom mom1 mom2 mom3 ROC_5 ROC_10 ROC_15 ROC_20 ... month_day-5 month_day-5^2 Close_ROC_day-5 Close_ROC_day-5^2 EMA10_ROC_day-5 EMA10_ROC_day-5^2 EMA20_ROC_day-5 EMA20_ROC_day-5^2 EMA50_ROC_day-5 EMA50_ROC_day-5^2
55 2415.239990 0.006985 0.008283 0.008840 -0.007055 0.000917 1.565594 3.185402 5.894885 9.117033 ... 3.0 9.0 0.006689 4.473834e-05 0.003607 0.000013 0.003339 0.000011 0.002181 0.000005
56 2398.760010 -0.011816 -0.006823 0.008283 0.008840 -0.007055 0.404753 1.687618 5.177407 7.283873 ... 3.0 9.0 0.004659 2.170992e-05 0.003802 0.000014 0.003468 0.000012 0.002284 0.000005
57 2397.409912 0.110328 -0.000563 -0.006823 0.008283 0.008840 0.256343 1.222311 4.584888 7.304113 ... 3.0 9.0 0.000917 8.402331e-07 0.003268 0.000011 0.003217 0.000010 0.002227 0.000005
58 2395.129883 -0.124568 -0.000951 -0.000563 -0.006823 0.008283 0.872637 1.160216 2.956553 7.008563 ... 3.0 9.0 -0.007055 4.977088e-05 0.001364 0.000002 0.002209 0.000005 0.001843 0.000003
59 2404.360107 -0.168958 0.003854 -0.000951 -0.000563 -0.006823 0.374059 1.784352 3.093639 5.752628 ... 3.0 9.0 0.008840 7.814714e-05 0.002731 0.000007 0.002854 0.000008 0.002130 0.000005
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
1979 6750.049805 0.058830 -0.005755 0.003153 -0.002750 0.003252 0.522862 2.947790 2.194980 2.405216 ... 11.0 121.0 -0.000237 5.602981e-08 0.001613 0.000003 0.001461 0.000002 0.001191 0.000001
1980 6750.939941 -0.116863 0.000132 -0.005755 0.003153 -0.002750 -0.199573 0.741356 1.838727 2.197162 ... 11.0 121.0 0.007372 5.434081e-05 0.002668 0.000007 0.002031 0.000004 0.001441 0.000002
1981 6757.600098 -0.000091 0.000987 0.000132 -0.005755 0.003153 -0.424963 0.875362 2.592598 2.016910 ... 11.0 121.0 0.003252 1.057747e-05 0.002775 0.000008 0.002150 0.000005 0.001514 0.000002
1982 6737.870117 0.005087 -0.002920 0.000987 0.000132 -0.005755 -0.441942 0.151616 2.113229 1.724273 ... 11.0 121.0 -0.002750 7.560430e-06 0.001758 0.000003 0.001674 0.000003 0.001341 0.000002
1983 6706.209961 -0.037891 -0.004699 -0.002920 0.000987 0.000132 -1.221221 -0.153648 2.168224 1.237727 ... 11.0 121.0 0.003153 9.942828e-06 0.002014 0.000004 0.001817 0.000003 0.001414 0.000002

1929 rows × 968 columns

1.2 Data standardization and train test split

We use the historical data to predict the future data. Therefore, we use lagged_cols as predictors.

# Filter out the lagged columns.
lagged_cols = [col for col in df.columns if '_day-' in col]
print("Input Features:", lagged_cols)

# Define target variable.
target_var_regression = 'Close_ROC'

# Define X and y.
X = df[lagged_cols]
y = df[target_var_regression]

# Standardize features using StandardScaler.
scaler = StandardScaler()
X_scaled = pd.DataFrame(
    scaler.fit_transform(X),
    columns=X.columns,
    index=X.index
)

# Split the data into training and testing sets.
split_ratio = 0.8  # 80% train data, 20% test data
split_index = int(len(df) * split_ratio)
X_train = X_scaled.iloc[:split_index]
X_test = X_scaled.iloc[split_index:]

y_train = y.iloc[:split_index]
y_test = y.iloc[split_index:]

print(X_train)
Input Features: ['Close_day-1', 'Close_day-1^2', 'Volume_day-1', 'Volume_day-1^2', 'mom_day-1', 'mom_day-1^2', 'mom1_day-1', 'mom1_day-1^2', 'mom2_day-1', 'mom2_day-1^2', 'mom3_day-1', 'mom3_day-1^2', 'ROC_5_day-1', 'ROC_5_day-1^2', 'ROC_10_day-1', 'ROC_10_day-1^2', 'ROC_15_day-1', 'ROC_15_day-1^2', 'ROC_20_day-1', 'ROC_20_day-1^2', 'EMA_10_day-1', 'EMA_10_day-1^2', 'EMA_20_day-1', 'EMA_20_day-1^2', 'EMA_50_day-1', 'EMA_50_day-1^2', 'DTB4WK_day-1', 'DTB4WK_day-1^2', 'DTB3_day-1', 'DTB3_day-1^2', 'DTB6_day-1', 'DTB6_day-1^2', 'DGS5_day-1', 'DGS5_day-1^2', 'DGS10_day-1', 'DGS10_day-1^2', 'Oil_day-1', 'Oil_day-1^2', 'Gold_day-1', 'Gold_day-1^2', 'DAAA_day-1', 'DAAA_day-1^2', 'DBAA_day-1', 'DBAA_day-1^2', 'GBP_day-1', 'GBP_day-1^2', 'JPY_day-1', 'JPY_day-1^2', 'CAD_day-1', 'CAD_day-1^2', 'CNY_day-1', 'CNY_day-1^2', 'AAPL_day-1', 'AAPL_day-1^2', 'AMZN_day-1', 'AMZN_day-1^2', 'GE_day-1', 'GE_day-1^2', 'JNJ_day-1', 'JNJ_day-1^2', 'JPM_day-1', 'JPM_day-1^2', 'MSFT_day-1', 'MSFT_day-1^2', 'WFC_day-1', 'WFC_day-1^2', 'XOM_day-1', 'XOM_day-1^2', 'FCHI_day-1', 'FCHI_day-1^2', 'FTSE_day-1', 'FTSE_day-1^2', 'GDAXI_day-1', 'GDAXI_day-1^2', 'GSPC_day-1', 'GSPC_day-1^2', 'HSI_day-1', 'HSI_day-1^2', 'DJI_day-1', 'DJI_day-1^2', 'SSEC_day-1', 'SSEC_day-1^2', 'RUT_day-1', 'RUT_day-1^2', 'NYSE_day-1', 'NYSE_day-1^2', 'TE1_day-1', 'TE1_day-1^2', 'TE2_day-1', 'TE2_day-1^2', 'TE3_day-1', 'TE3_day-1^2', 'TE5_day-1', 'TE5_day-1^2', 'TE6_day-1', 'TE6_day-1^2', 'DE1_day-1', 'DE1_day-1^2', 'DE2_day-1', 'DE2_day-1^2', 'DE4_day-1', 'DE4_day-1^2', 'DE5_day-1', 'DE5_day-1^2', 'DE6_day-1', 'DE6_day-1^2', 'CTB3M_day-1', 'CTB3M_day-1^2', 'CTB6M_day-1', 'CTB6M_day-1^2', 'CTB1Y_day-1', 'CTB1Y_day-1^2', 'AUD_day-1', 'AUD_day-1^2', 'Brent_day-1', 'Brent_day-1^2', 'CAC-F_day-1', 'CAC-F_day-1^2', 'copper-F_day-1', 'copper-F_day-1^2', 'WIT-oil_day-1', 'WIT-oil_day-1^2', 'DAX-F_day-1', 'DAX-F_day-1^2', 'DJI-F_day-1', 'DJI-F_day-1^2', 'EUR_day-1', 'EUR_day-1^2', 'FTSE-F_day-1', 'FTSE-F_day-1^2', 'gold-F_day-1', 'gold-F_day-1^2', 'HSI-F_day-1', 'HSI-F_day-1^2', 'KOSPI-F_day-1', 'KOSPI-F_day-1^2', 'NASDAQ-F_day-1', 'NASDAQ-F_day-1^2', 'GAS-F_day-1', 'GAS-F_day-1^2', 'Nikkei-F_day-1', 'Nikkei-F_day-1^2', 'NZD_day-1', 'NZD_day-1^2', 'silver-F_day-1', 'silver-F_day-1^2', 'RUSSELL-F_day-1', 'RUSSELL-F_day-1^2', 'S&P-F_day-1', 'S&P-F_day-1^2', 'CHF_day-1', 'CHF_day-1^2', 'Dollar index-F_day-1', 'Dollar index-F_day-1^2', 'Dollar index_day-1', 'Dollar index_day-1^2', 'wheat-F_day-1', 'wheat-F_day-1^2', 'XAG_day-1', 'XAG_day-1^2', 'XAU_day-1', 'XAU_day-1^2', 'day_of_week_day-1', 'day_of_week_day-1^2', 'day_of_month_day-1', 'day_of_month_day-1^2', 'month_day-1', 'month_day-1^2', 'Close_ROC_day-1', 'Close_ROC_day-1^2', 'EMA10_ROC_day-1', 'EMA10_ROC_day-1^2', 'EMA20_ROC_day-1', 'EMA20_ROC_day-1^2', 'EMA50_ROC_day-1', 'EMA50_ROC_day-1^2', 'Close_day-2', 'Close_day-2^2', 'Volume_day-2', 'Volume_day-2^2', 'mom_day-2', 'mom_day-2^2', 'mom1_day-2', 'mom1_day-2^2', 'mom2_day-2', 'mom2_day-2^2', 'mom3_day-2', 'mom3_day-2^2', 'ROC_5_day-2', 'ROC_5_day-2^2', 'ROC_10_day-2', 'ROC_10_day-2^2', 'ROC_15_day-2', 'ROC_15_day-2^2', 'ROC_20_day-2', 'ROC_20_day-2^2', 'EMA_10_day-2', 'EMA_10_day-2^2', 'EMA_20_day-2', 'EMA_20_day-2^2', 'EMA_50_day-2', 'EMA_50_day-2^2', 'DTB4WK_day-2', 'DTB4WK_day-2^2', 'DTB3_day-2', 'DTB3_day-2^2', 'DTB6_day-2', 'DTB6_day-2^2', 'DGS5_day-2', 'DGS5_day-2^2', 'DGS10_day-2', 'DGS10_day-2^2', 'Oil_day-2', 'Oil_day-2^2', 'Gold_day-2', 'Gold_day-2^2', 'DAAA_day-2', 'DAAA_day-2^2', 'DBAA_day-2', 'DBAA_day-2^2', 'GBP_day-2', 'GBP_day-2^2', 'JPY_day-2', 'JPY_day-2^2', 'CAD_day-2', 'CAD_day-2^2', 'CNY_day-2', 'CNY_day-2^2', 'AAPL_day-2', 'AAPL_day-2^2', 'AMZN_day-2', 'AMZN_day-2^2', 'GE_day-2', 'GE_day-2^2', 'JNJ_day-2', 'JNJ_day-2^2', 'JPM_day-2', 'JPM_day-2^2', 'MSFT_day-2', 'MSFT_day-2^2', 'WFC_day-2', 'WFC_day-2^2', 'XOM_day-2', 'XOM_day-2^2', 'FCHI_day-2', 'FCHI_day-2^2', 'FTSE_day-2', 'FTSE_day-2^2', 'GDAXI_day-2', 'GDAXI_day-2^2', 'GSPC_day-2', 'GSPC_day-2^2', 'HSI_day-2', 'HSI_day-2^2', 'DJI_day-2', 'DJI_day-2^2', 'SSEC_day-2', 'SSEC_day-2^2', 'RUT_day-2', 'RUT_day-2^2', 'NYSE_day-2', 'NYSE_day-2^2', 'TE1_day-2', 'TE1_day-2^2', 'TE2_day-2', 'TE2_day-2^2', 'TE3_day-2', 'TE3_day-2^2', 'TE5_day-2', 'TE5_day-2^2', 'TE6_day-2', 'TE6_day-2^2', 'DE1_day-2', 'DE1_day-2^2', 'DE2_day-2', 'DE2_day-2^2', 'DE4_day-2', 'DE4_day-2^2', 'DE5_day-2', 'DE5_day-2^2', 'DE6_day-2', 'DE6_day-2^2', 'CTB3M_day-2', 'CTB3M_day-2^2', 'CTB6M_day-2', 'CTB6M_day-2^2', 'CTB1Y_day-2', 'CTB1Y_day-2^2', 'AUD_day-2', 'AUD_day-2^2', 'Brent_day-2', 'Brent_day-2^2', 'CAC-F_day-2', 'CAC-F_day-2^2', 'copper-F_day-2', 'copper-F_day-2^2', 'WIT-oil_day-2', 'WIT-oil_day-2^2', 'DAX-F_day-2', 'DAX-F_day-2^2', 'DJI-F_day-2', 'DJI-F_day-2^2', 'EUR_day-2', 'EUR_day-2^2', 'FTSE-F_day-2', 'FTSE-F_day-2^2', 'gold-F_day-2', 'gold-F_day-2^2', 'HSI-F_day-2', 'HSI-F_day-2^2', 'KOSPI-F_day-2', 'KOSPI-F_day-2^2', 'NASDAQ-F_day-2', 'NASDAQ-F_day-2^2', 'GAS-F_day-2', 'GAS-F_day-2^2', 'Nikkei-F_day-2', 'Nikkei-F_day-2^2', 'NZD_day-2', 'NZD_day-2^2', 'silver-F_day-2', 'silver-F_day-2^2', 'RUSSELL-F_day-2', 'RUSSELL-F_day-2^2', 'S&P-F_day-2', 'S&P-F_day-2^2', 'CHF_day-2', 'CHF_day-2^2', 'Dollar index-F_day-2', 'Dollar index-F_day-2^2', 'Dollar index_day-2', 'Dollar index_day-2^2', 'wheat-F_day-2', 'wheat-F_day-2^2', 'XAG_day-2', 'XAG_day-2^2', 'XAU_day-2', 'XAU_day-2^2', 'day_of_week_day-2', 'day_of_week_day-2^2', 'day_of_month_day-2', 'day_of_month_day-2^2', 'month_day-2', 'month_day-2^2', 'Close_ROC_day-2', 'Close_ROC_day-2^2', 'EMA10_ROC_day-2', 'EMA10_ROC_day-2^2', 'EMA20_ROC_day-2', 'EMA20_ROC_day-2^2', 'EMA50_ROC_day-2', 'EMA50_ROC_day-2^2', 'Close_day-3', 'Close_day-3^2', 'Volume_day-3', 'Volume_day-3^2', 'mom_day-3', 'mom_day-3^2', 'mom1_day-3', 'mom1_day-3^2', 'mom2_day-3', 'mom2_day-3^2', 'mom3_day-3', 'mom3_day-3^2', 'ROC_5_day-3', 'ROC_5_day-3^2', 'ROC_10_day-3', 'ROC_10_day-3^2', 'ROC_15_day-3', 'ROC_15_day-3^2', 'ROC_20_day-3', 'ROC_20_day-3^2', 'EMA_10_day-3', 'EMA_10_day-3^2', 'EMA_20_day-3', 'EMA_20_day-3^2', 'EMA_50_day-3', 'EMA_50_day-3^2', 'DTB4WK_day-3', 'DTB4WK_day-3^2', 'DTB3_day-3', 'DTB3_day-3^2', 'DTB6_day-3', 'DTB6_day-3^2', 'DGS5_day-3', 'DGS5_day-3^2', 'DGS10_day-3', 'DGS10_day-3^2', 'Oil_day-3', 'Oil_day-3^2', 'Gold_day-3', 'Gold_day-3^2', 'DAAA_day-3', 'DAAA_day-3^2', 'DBAA_day-3', 'DBAA_day-3^2', 'GBP_day-3', 'GBP_day-3^2', 'JPY_day-3', 'JPY_day-3^2', 'CAD_day-3', 'CAD_day-3^2', 'CNY_day-3', 'CNY_day-3^2', 'AAPL_day-3', 'AAPL_day-3^2', 'AMZN_day-3', 'AMZN_day-3^2', 'GE_day-3', 'GE_day-3^2', 'JNJ_day-3', 'JNJ_day-3^2', 'JPM_day-3', 'JPM_day-3^2', 'MSFT_day-3', 'MSFT_day-3^2', 'WFC_day-3', 'WFC_day-3^2', 'XOM_day-3', 'XOM_day-3^2', 'FCHI_day-3', 'FCHI_day-3^2', 'FTSE_day-3', 'FTSE_day-3^2', 'GDAXI_day-3', 'GDAXI_day-3^2', 'GSPC_day-3', 'GSPC_day-3^2', 'HSI_day-3', 'HSI_day-3^2', 'DJI_day-3', 'DJI_day-3^2', 'SSEC_day-3', 'SSEC_day-3^2', 'RUT_day-3', 'RUT_day-3^2', 'NYSE_day-3', 'NYSE_day-3^2', 'TE1_day-3', 'TE1_day-3^2', 'TE2_day-3', 'TE2_day-3^2', 'TE3_day-3', 'TE3_day-3^2', 'TE5_day-3', 'TE5_day-3^2', 'TE6_day-3', 'TE6_day-3^2', 'DE1_day-3', 'DE1_day-3^2', 'DE2_day-3', 'DE2_day-3^2', 'DE4_day-3', 'DE4_day-3^2', 'DE5_day-3', 'DE5_day-3^2', 'DE6_day-3', 'DE6_day-3^2', 'CTB3M_day-3', 'CTB3M_day-3^2', 'CTB6M_day-3', 'CTB6M_day-3^2', 'CTB1Y_day-3', 'CTB1Y_day-3^2', 'AUD_day-3', 'AUD_day-3^2', 'Brent_day-3', 'Brent_day-3^2', 'CAC-F_day-3', 'CAC-F_day-3^2', 'copper-F_day-3', 'copper-F_day-3^2', 'WIT-oil_day-3', 'WIT-oil_day-3^2', 'DAX-F_day-3', 'DAX-F_day-3^2', 'DJI-F_day-3', 'DJI-F_day-3^2', 'EUR_day-3', 'EUR_day-3^2', 'FTSE-F_day-3', 'FTSE-F_day-3^2', 'gold-F_day-3', 'gold-F_day-3^2', 'HSI-F_day-3', 'HSI-F_day-3^2', 'KOSPI-F_day-3', 'KOSPI-F_day-3^2', 'NASDAQ-F_day-3', 'NASDAQ-F_day-3^2', 'GAS-F_day-3', 'GAS-F_day-3^2', 'Nikkei-F_day-3', 'Nikkei-F_day-3^2', 'NZD_day-3', 'NZD_day-3^2', 'silver-F_day-3', 'silver-F_day-3^2', 'RUSSELL-F_day-3', 'RUSSELL-F_day-3^2', 'S&P-F_day-3', 'S&P-F_day-3^2', 'CHF_day-3', 'CHF_day-3^2', 'Dollar index-F_day-3', 'Dollar index-F_day-3^2', 'Dollar index_day-3', 'Dollar index_day-3^2', 'wheat-F_day-3', 'wheat-F_day-3^2', 'XAG_day-3', 'XAG_day-3^2', 'XAU_day-3', 'XAU_day-3^2', 'day_of_week_day-3', 'day_of_week_day-3^2', 'day_of_month_day-3', 'day_of_month_day-3^2', 'month_day-3', 'month_day-3^2', 'Close_ROC_day-3', 'Close_ROC_day-3^2', 'EMA10_ROC_day-3', 'EMA10_ROC_day-3^2', 'EMA20_ROC_day-3', 'EMA20_ROC_day-3^2', 'EMA50_ROC_day-3', 'EMA50_ROC_day-3^2', 'Close_day-4', 'Close_day-4^2', 'Volume_day-4', 'Volume_day-4^2', 'mom_day-4', 'mom_day-4^2', 'mom1_day-4', 'mom1_day-4^2', 'mom2_day-4', 'mom2_day-4^2', 'mom3_day-4', 'mom3_day-4^2', 'ROC_5_day-4', 'ROC_5_day-4^2', 'ROC_10_day-4', 'ROC_10_day-4^2', 'ROC_15_day-4', 'ROC_15_day-4^2', 'ROC_20_day-4', 'ROC_20_day-4^2', 'EMA_10_day-4', 'EMA_10_day-4^2', 'EMA_20_day-4', 'EMA_20_day-4^2', 'EMA_50_day-4', 'EMA_50_day-4^2', 'DTB4WK_day-4', 'DTB4WK_day-4^2', 'DTB3_day-4', 'DTB3_day-4^2', 'DTB6_day-4', 'DTB6_day-4^2', 'DGS5_day-4', 'DGS5_day-4^2', 'DGS10_day-4', 'DGS10_day-4^2', 'Oil_day-4', 'Oil_day-4^2', 'Gold_day-4', 'Gold_day-4^2', 'DAAA_day-4', 'DAAA_day-4^2', 'DBAA_day-4', 'DBAA_day-4^2', 'GBP_day-4', 'GBP_day-4^2', 'JPY_day-4', 'JPY_day-4^2', 'CAD_day-4', 'CAD_day-4^2', 'CNY_day-4', 'CNY_day-4^2', 'AAPL_day-4', 'AAPL_day-4^2', 'AMZN_day-4', 'AMZN_day-4^2', 'GE_day-4', 'GE_day-4^2', 'JNJ_day-4', 'JNJ_day-4^2', 'JPM_day-4', 'JPM_day-4^2', 'MSFT_day-4', 'MSFT_day-4^2', 'WFC_day-4', 'WFC_day-4^2', 'XOM_day-4', 'XOM_day-4^2', 'FCHI_day-4', 'FCHI_day-4^2', 'FTSE_day-4', 'FTSE_day-4^2', 'GDAXI_day-4', 'GDAXI_day-4^2', 'GSPC_day-4', 'GSPC_day-4^2', 'HSI_day-4', 'HSI_day-4^2', 'DJI_day-4', 'DJI_day-4^2', 'SSEC_day-4', 'SSEC_day-4^2', 'RUT_day-4', 'RUT_day-4^2', 'NYSE_day-4', 'NYSE_day-4^2', 'TE1_day-4', 'TE1_day-4^2', 'TE2_day-4', 'TE2_day-4^2', 'TE3_day-4', 'TE3_day-4^2', 'TE5_day-4', 'TE5_day-4^2', 'TE6_day-4', 'TE6_day-4^2', 'DE1_day-4', 'DE1_day-4^2', 'DE2_day-4', 'DE2_day-4^2', 'DE4_day-4', 'DE4_day-4^2', 'DE5_day-4', 'DE5_day-4^2', 'DE6_day-4', 'DE6_day-4^2', 'CTB3M_day-4', 'CTB3M_day-4^2', 'CTB6M_day-4', 'CTB6M_day-4^2', 'CTB1Y_day-4', 'CTB1Y_day-4^2', 'AUD_day-4', 'AUD_day-4^2', 'Brent_day-4', 'Brent_day-4^2', 'CAC-F_day-4', 'CAC-F_day-4^2', 'copper-F_day-4', 'copper-F_day-4^2', 'WIT-oil_day-4', 'WIT-oil_day-4^2', 'DAX-F_day-4', 'DAX-F_day-4^2', 'DJI-F_day-4', 'DJI-F_day-4^2', 'EUR_day-4', 'EUR_day-4^2', 'FTSE-F_day-4', 'FTSE-F_day-4^2', 'gold-F_day-4', 'gold-F_day-4^2', 'HSI-F_day-4', 'HSI-F_day-4^2', 'KOSPI-F_day-4', 'KOSPI-F_day-4^2', 'NASDAQ-F_day-4', 'NASDAQ-F_day-4^2', 'GAS-F_day-4', 'GAS-F_day-4^2', 'Nikkei-F_day-4', 'Nikkei-F_day-4^2', 'NZD_day-4', 'NZD_day-4^2', 'silver-F_day-4', 'silver-F_day-4^2', 'RUSSELL-F_day-4', 'RUSSELL-F_day-4^2', 'S&P-F_day-4', 'S&P-F_day-4^2', 'CHF_day-4', 'CHF_day-4^2', 'Dollar index-F_day-4', 'Dollar index-F_day-4^2', 'Dollar index_day-4', 'Dollar index_day-4^2', 'wheat-F_day-4', 'wheat-F_day-4^2', 'XAG_day-4', 'XAG_day-4^2', 'XAU_day-4', 'XAU_day-4^2', 'day_of_week_day-4', 'day_of_week_day-4^2', 'day_of_month_day-4', 'day_of_month_day-4^2', 'month_day-4', 'month_day-4^2', 'Close_ROC_day-4', 'Close_ROC_day-4^2', 'EMA10_ROC_day-4', 'EMA10_ROC_day-4^2', 'EMA20_ROC_day-4', 'EMA20_ROC_day-4^2', 'EMA50_ROC_day-4', 'EMA50_ROC_day-4^2', 'Close_day-5', 'Close_day-5^2', 'Volume_day-5', 'Volume_day-5^2', 'mom_day-5', 'mom_day-5^2', 'mom1_day-5', 'mom1_day-5^2', 'mom2_day-5', 'mom2_day-5^2', 'mom3_day-5', 'mom3_day-5^2', 'ROC_5_day-5', 'ROC_5_day-5^2', 'ROC_10_day-5', 'ROC_10_day-5^2', 'ROC_15_day-5', 'ROC_15_day-5^2', 'ROC_20_day-5', 'ROC_20_day-5^2', 'EMA_10_day-5', 'EMA_10_day-5^2', 'EMA_20_day-5', 'EMA_20_day-5^2', 'EMA_50_day-5', 'EMA_50_day-5^2', 'DTB4WK_day-5', 'DTB4WK_day-5^2', 'DTB3_day-5', 'DTB3_day-5^2', 'DTB6_day-5', 'DTB6_day-5^2', 'DGS5_day-5', 'DGS5_day-5^2', 'DGS10_day-5', 'DGS10_day-5^2', 'Oil_day-5', 'Oil_day-5^2', 'Gold_day-5', 'Gold_day-5^2', 'DAAA_day-5', 'DAAA_day-5^2', 'DBAA_day-5', 'DBAA_day-5^2', 'GBP_day-5', 'GBP_day-5^2', 'JPY_day-5', 'JPY_day-5^2', 'CAD_day-5', 'CAD_day-5^2', 'CNY_day-5', 'CNY_day-5^2', 'AAPL_day-5', 'AAPL_day-5^2', 'AMZN_day-5', 'AMZN_day-5^2', 'GE_day-5', 'GE_day-5^2', 'JNJ_day-5', 'JNJ_day-5^2', 'JPM_day-5', 'JPM_day-5^2', 'MSFT_day-5', 'MSFT_day-5^2', 'WFC_day-5', 'WFC_day-5^2', 'XOM_day-5', 'XOM_day-5^2', 'FCHI_day-5', 'FCHI_day-5^2', 'FTSE_day-5', 'FTSE_day-5^2', 'GDAXI_day-5', 'GDAXI_day-5^2', 'GSPC_day-5', 'GSPC_day-5^2', 'HSI_day-5', 'HSI_day-5^2', 'DJI_day-5', 'DJI_day-5^2', 'SSEC_day-5', 'SSEC_day-5^2', 'RUT_day-5', 'RUT_day-5^2', 'NYSE_day-5', 'NYSE_day-5^2', 'TE1_day-5', 'TE1_day-5^2', 'TE2_day-5', 'TE2_day-5^2', 'TE3_day-5', 'TE3_day-5^2', 'TE5_day-5', 'TE5_day-5^2', 'TE6_day-5', 'TE6_day-5^2', 'DE1_day-5', 'DE1_day-5^2', 'DE2_day-5', 'DE2_day-5^2', 'DE4_day-5', 'DE4_day-5^2', 'DE5_day-5', 'DE5_day-5^2', 'DE6_day-5', 'DE6_day-5^2', 'CTB3M_day-5', 'CTB3M_day-5^2', 'CTB6M_day-5', 'CTB6M_day-5^2', 'CTB1Y_day-5', 'CTB1Y_day-5^2', 'AUD_day-5', 'AUD_day-5^2', 'Brent_day-5', 'Brent_day-5^2', 'CAC-F_day-5', 'CAC-F_day-5^2', 'copper-F_day-5', 'copper-F_day-5^2', 'WIT-oil_day-5', 'WIT-oil_day-5^2', 'DAX-F_day-5', 'DAX-F_day-5^2', 'DJI-F_day-5', 'DJI-F_day-5^2', 'EUR_day-5', 'EUR_day-5^2', 'FTSE-F_day-5', 'FTSE-F_day-5^2', 'gold-F_day-5', 'gold-F_day-5^2', 'HSI-F_day-5', 'HSI-F_day-5^2', 'KOSPI-F_day-5', 'KOSPI-F_day-5^2', 'NASDAQ-F_day-5', 'NASDAQ-F_day-5^2', 'GAS-F_day-5', 'GAS-F_day-5^2', 'Nikkei-F_day-5', 'Nikkei-F_day-5^2', 'NZD_day-5', 'NZD_day-5^2', 'silver-F_day-5', 'silver-F_day-5^2', 'RUSSELL-F_day-5', 'RUSSELL-F_day-5^2', 'S&P-F_day-5', 'S&P-F_day-5^2', 'CHF_day-5', 'CHF_day-5^2', 'Dollar index-F_day-5', 'Dollar index-F_day-5^2', 'Dollar index_day-5', 'Dollar index_day-5^2', 'wheat-F_day-5', 'wheat-F_day-5^2', 'XAG_day-5', 'XAG_day-5^2', 'XAU_day-5', 'XAU_day-5^2', 'day_of_week_day-5', 'day_of_week_day-5^2', 'day_of_month_day-5', 'day_of_month_day-5^2', 'month_day-5', 'month_day-5^2', 'Close_ROC_day-5', 'Close_ROC_day-5^2', 'EMA10_ROC_day-5', 'EMA10_ROC_day-5^2', 'EMA20_ROC_day-5', 'EMA20_ROC_day-5^2', 'EMA50_ROC_day-5', 'EMA50_ROC_day-5^2']
      Close_day-1  Close_day-1^2  Volume_day-1  Volume_day-1^2  mom_day-1  \
55      -1.316708      -1.145535     -0.878617       -0.022459   0.779534   
56      -1.300546      -1.136318     -0.048001       -0.062368   0.726812   
57      -1.313971      -1.143979     -0.123872       -0.062276  -0.701704   
58      -1.315071      -1.144605      0.369029       -0.050116  -0.109669   
59      -1.316928      -1.145660     -0.578869       -0.046736  -0.146381   
...           ...            ...           ...             ...        ...   
1593     0.622093       0.502464      0.325335       -0.052412  -0.645461   
1594     0.656495       0.541583     -0.918432       -0.018396   0.779839   
1595     0.612203       0.491282      0.146735       -0.059333  -1.123691   
1596     0.581589       0.456847     -0.144396       -0.062128  -0.802541   
1597     0.574624       0.449051     -0.205371       -0.061382  -0.227548   

      mom_day-1^2  mom1_day-1  mom1_day-1^2  mom2_day-1  mom2_day-1^2  ...  \
55      -0.130427   -0.723318     -0.239273    0.030443     -0.426815  ...   
56      -0.167015    0.779653     -0.130513   -0.723315     -0.239273  ...   
57      -0.251500    0.726937     -0.167101    0.779657     -0.130512  ...   
58      -0.428728   -0.701426     -0.251588    0.726941     -0.167101  ...   
59      -0.426476   -0.109455     -0.428822   -0.701423     -0.251588  ...   
...           ...         ...           ...         ...           ...  ...   
1593    -0.281251   -1.181046      0.112329   -0.542522     -0.328662  ...   
1594    -0.130209   -0.645190     -0.281341   -1.181042      0.112330  ...   
1595     0.058214    0.779958     -0.130294   -0.645186     -0.281340  ...   
1596    -0.191370   -1.123368      0.058133    0.779961     -0.130294  ...   
1597    -0.417395   -0.802253     -0.191457   -1.123365      0.058134  ...   

      month_day-5  month_day-5^2  Close_ROC_day-5  Close_ROC_day-5^2  \
55      -1.069114      -1.012034         0.575377          -0.258634   
56      -1.069114      -1.012034         0.383501          -0.346900   
57      -1.069114      -1.012034         0.029610          -0.426891   
58      -1.069114      -1.012034        -0.724125          -0.239345   
59      -1.069114      -1.012034         0.778801          -0.130582   
...           ...            ...              ...                ...   
1593    -0.770184      -0.856133        -0.258263          -0.412757   
1594    -0.770184      -0.856133        -0.202110          -0.421092   
1595    -0.770184      -0.856133        -0.543337          -0.328736   
1596    -0.770184      -0.856133        -1.181839           0.112266   
1597    -0.770184      -0.856133        -0.645999          -0.281413   

      EMA10_ROC_day-5  EMA10_ROC_day-5^2  EMA20_ROC_day-5  EMA20_ROC_day-5^2  \
55           0.993332           0.155614         1.348414           0.789463   
56           1.056562           0.224377         1.411268           0.895477   
57           0.882989           0.044257         1.289674           0.694041   
58           0.263398          -0.376990         0.801326           0.037388   
59           0.708346          -0.109536         1.113639           0.429215   
...               ...                ...              ...                ...   
1593        -0.478602          -0.425671        -0.168581          -0.543339   
1594        -0.514958          -0.415289        -0.249065          -0.548287   
1595        -0.757198          -0.315673        -0.488311          -0.523867   
1596        -1.351179           0.152671        -1.013943          -0.264569   
1597        -1.504202           0.324898        -1.227174          -0.078794   

      EMA50_ROC_day-5  EMA50_ROC_day-5^2  
55           1.368601           1.338713  
56           1.454741           1.540091  
57           1.407105           1.427586  
58           1.084101           0.739215  
59           1.325418           1.241235  
...               ...                ...  
1593         0.174005          -0.502153  
1594         0.096821          -0.560023  
1595        -0.098169          -0.673204  
1596        -0.509592          -0.756795  
1597        -0.713234          -0.720245  

[1543 rows x 880 columns]

1.3 Exploratory data visualization

1.3.1 Dimension reduction method and probability density curves

Here, we used UMAP and Probability Density Curves to visualize the train and test data.

UMAP is a dimension reduction method by which we can visualize the high dimensional data in a 2-D graph.

We can see that the distribution of train and test data are different. Therefore, we assume that training a good model tends to be hard for this dataset.

# Initialize the UMAP model (using a fixed random state for reproducibility).
umap_model = UMAP(n_components=2, random_state=42)

# Fit UMAP on the training data and transform both training and test data.
X_train_umap = umap_model.fit_transform(X_train)
X_test_umap = umap_model.transform(X_test)

# Plot the UMAP projection.
plt.figure(figsize=(10, 8))
plt.scatter(
    X_train_umap[:, 0],
    X_train_umap[:, 1],
    c='blue',
    label='Train',
    alpha=0.6
)
plt.scatter(
    X_test_umap[:, 0],
    X_test_umap[:, 1],
    c='red',
    label='Test',
    alpha=0.6
)
plt.xlabel('UMAP Dimension 1')
plt.ylabel('UMAP Dimension 2')
plt.title('UMAP Projection of Train and Test Data')
plt.legend()
plt.show()
C:\Users\zln92\AppData\Roaming\Python\Python311\site-packages\umap\umap_.py:1952: UserWarning: n_jobs value 1 overridden to 1 by setting random_state. Use no seed for parallelism.
  warn(

plt.figure(figsize=(10, 6))

sns.kdeplot(y_train, label="Train", color="blue", shade=True)
sns.kdeplot(y_test, label="Test", color="red", shade=True)

plt.xlabel("Close_ROC")
plt.ylabel("Density")
plt.title("Probability Density Curve for Close Rate of Change (Train vs Test)")
plt.legend()

plt.show()
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3388851737.py:3: FutureWarning: 

`shade` is now deprecated in favor of `fill`; setting `fill=True`.
This will become an error in seaborn v0.14.0; please update your code.

  sns.kdeplot(y_train, label="Train", color="blue", shade=True)
c:\ProgramData\anaconda3\Lib\site-packages\seaborn\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
  with pd.option_context('mode.use_inf_as_na', True):
C:\Users\zln92\AppData\Local\Temp\ipykernel_9188\3388851737.py:4: FutureWarning: 

`shade` is now deprecated in favor of `fill`; setting `fill=True`.
This will become an error in seaborn v0.14.0; please update your code.

  sns.kdeplot(y_test, label="Test", color="red", shade=True)
c:\ProgramData\anaconda3\Lib\site-packages\seaborn\_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
  with pd.option_context('mode.use_inf_as_na', True):

1.3.2 Visualization of “Close_ROC”

We can also see it in another perspective. The daily rate of change of Nasdaq Composite Index looks like noise, which could be hard to predict.

plt.figure(figsize=(12, 6))
plt.plot(
    df_raw["Date"],
    df_raw["Close_ROC"],
    label="True Close_ROC",
    linewidth=1
)

plt.title("Rate of Change of Nasdaq Index")
plt.xlabel("Date")
plt.ylabel("Close_ROC")
plt.legend()
plt.grid(True)
plt.show()

1.4 Baseline model

The baseline model is just predict every Nasdaq index value on t day to be the value on t-1 day. It reflects the Martingale in probability theory. [3]

\[{\displaystyle \mathbf {E} (\vert X_{n}\vert )<\infty }\] \[\mathbf {E} (X_{n+1}\mid X_{1},\ldots ,X_{n})=X_{n}.\]

Since we are predicting the value doesn’t change from t-1 day to t day, the predicted rate of change (‘Close_ROC’) of our baseline model is just 0.

In this project, we will use Root Mean Sqare Error (RMSE) to evaluate how the predicted value deviate from the true value in a more intuitive way.

# Create baseline predictions (all zeros) for training and test sets.
baseline_train_predict = pd.Series(0, index=range(len(X_train)))
baseline_test_predict = pd.Series(0, index=range(len(X_test)))

# Calculate Mean Squared Error for training and test sets.
baseline_mse_train_final = mean_squared_error(baseline_train_predict, y_train)
baseline_mse_test_final = mean_squared_error(baseline_test_predict, y_test)

# Calculate Root Mean Squared Error.
baseline_rmse_train_final = np.sqrt(baseline_mse_train_final)
baseline_rmse_test_final = np.sqrt(baseline_mse_test_final)

# Print the results.
print("Baseline Regression Model Train MSE:", baseline_mse_train_final)
print("Baseline Regression Model Test MSE:", baseline_mse_test_final)
print("Baseline Regression Model Train RMSE:", baseline_rmse_train_final)
print("Baseline Regression Model Test RMSE:", baseline_rmse_test_final)
Baseline Regression Model Train MSE: 0.0001273147808231767
Baseline Regression Model Test MSE: 5.152090781204474e-05
Baseline Regression Model Train RMSE: 0.01128338516683609
Baseline Regression Model Test RMSE: 0.00717780661567618

2. Linear Regression

2.1 Linear regression with all the features

Since we have squared features, this is actually polynomial regression. We just treat them as independent features, so we call “linear regression” here.

# Initialize and fit the linear regression model.
lin_reg = LinearRegression()
lin_reg.fit(X_train, y_train)

# Print training and testing MSE.
train_mse = mean_squared_error(lin_reg.predict(X_train), y_train)
test_mse = mean_squared_error(lin_reg.predict(X_test), y_test)

print("Training mean_squared_error:", train_mse)
print("Testing mean_squared_error:", test_mse)
Training mean_squared_error: 4.631345421141122e-05
Testing mean_squared_error: 0.02637718530839419
# Output model parameters and score.
print("Model coefficients:", lin_reg.coef_)
print("Model intercept:", lin_reg.intercept_)
Model coefficients: [ 2.62057358e+07 -2.96578327e+00 -4.13480215e-04 -2.72071920e-05
 -1.44017558e+05  1.08345848e+05 -3.83533363e+08 -1.91476076e+08
  3.32686386e+08 -3.68066553e+07  1.42758759e+08 -1.02127726e+09
  1.47720671e+00 -3.62809338e-02  2.81973891e-02  1.54078007e-04
  1.03226490e-02  8.03850591e-04  3.86587158e-03 -7.49139115e-04
 -7.99382745e+07  3.06860472e+01 -9.05965750e+07 -4.54048501e+01
 -7.21136865e+07  3.83088106e+01 -4.45410220e+08  6.79812764e-02
  8.55298351e+08 -9.78320895e-02 -5.46330650e+07  7.55610084e-02
 -2.95291096e-03  1.14880130e-02  3.76559227e+08  2.28153099e-01
  2.10749358e-03  1.81356270e-03 -6.28710911e-03 -7.41733983e-03
 -7.72151243e+08 -6.47891592e-02 -3.65905154e+08 -7.72383958e-01
 -2.26842239e-04 -3.40396538e-04  7.73995183e-04 -2.21330673e-04
 -4.31597233e-04 -4.28985804e-04 -6.03104010e-04  4.24114987e-04
 -2.10508704e-04 -4.15660441e-04 -8.28200020e-04 -2.55010091e-04
 -1.24806305e-04 -2.48365104e-05 -8.67899507e-06 -9.38728452e-04
 -3.14038247e-04  6.48051500e-05 -1.09843910e-04  2.30763108e-04
 -6.44342974e-04  6.96144998e-05 -1.93879940e-04 -3.78049910e-04
 -9.99668613e-04  1.44044682e-03  2.07625888e-03 -7.32921064e-04
  1.91627815e-03  1.51914731e-03  1.26789380e-02 -4.05019894e-03
 -4.49717045e-04  2.38418579e-06 -9.28389281e-03  2.46874616e-03
  6.05840236e-04  3.62843275e-04  2.59920582e-03  8.25606287e-03
 -2.50494666e-03  6.75324351e-04 -4.96984245e+08  2.57943077e-02
  1.41094127e+09  1.48746443e-01 -7.44916334e+08 -4.16972808e-01
 -3.66827576e+07 -4.96551488e-03 -1.09662973e+08  5.89082390e-03
 -3.31723571e+08 -2.32027322e-02  4.38763215e+08  1.42487660e-02
 -2.97501488e+08  1.08641377e+00  1.09941140e+08  1.35141216e-01
  8.55251198e+08 -1.56077679e-01 -1.46519393e-03  3.91995534e-04
 -1.66719779e-03  6.44147396e-04  4.99680638e-04 -2.11019143e-02
 -5.02852723e-04 -4.82596457e-04  1.74440444e-04 -1.90682709e-04
  1.51686370e-03  1.65253878e-04  7.86118209e-04  2.66898423e-05
 -2.18183175e-03 -3.47549096e-04 -2.00533681e-03 -2.17219070e-03
  5.87402191e-03 -2.01880932e-03 -2.13204045e-03 -1.44053251e-04
 -1.85622275e-03 -3.54498625e-04  5.21294773e-04 -3.44254076e-04
  9.89805907e-04  2.32450664e-04 -4.98671085e-04 -6.44958578e-04
  9.33244824e-04  2.64229253e-03 -6.23449683e-04 -2.65441835e-04
  1.49097294e-04 -1.91995874e-04 -3.00809741e-04  1.73951499e-04
 -6.03713095e-04 -9.93054360e-04 -3.84919345e-04 -4.43592109e-03
 -3.98005359e-03  4.17549163e-03  4.94679436e-04  3.55049036e-04
 -4.55371011e-03  1.43658184e-03  1.13740435e-03 -5.35298139e-04
  9.96394083e-05  2.48168595e-04 -3.32668424e-05  1.34536251e-03
  8.28970224e-04  3.19182873e-04 -9.38921375e-03  4.71939472e-03
 -2.79052742e-03  3.52782756e-03  4.36417758e-04  4.33474779e-05
  1.44019503e+05 -1.08345880e+05 -7.07136685e+00  1.44147981e-01
  4.69361988e+00 -1.11443514e-01 -1.50132220e+00  3.95782832e-02
 -7.58076859e+07  2.99460695e+00  3.75622651e-04 -7.50156119e-04
  3.83694284e+08  1.91701349e+08 -9.18530914e+08  2.73091193e+08
  3.62502912e+08  1.52348178e+08  4.77554878e+08 -5.35554408e+08
 -5.57312391e-01  1.40600875e-02  2.43721716e-02 -2.65014917e-03
  8.74751061e-03 -1.63334794e-03  7.03550130e-03 -1.67050026e-03
  3.48745010e+08 -4.99560316e+01  2.54087698e+08  4.90134665e+01
  2.55770365e+08  2.61316518e+00 -1.38367010e+09 -5.43577196e-02
  1.59453852e+09  1.00604813e-01 -2.50301275e+08 -1.56793077e-01
  9.19553638e-03 -8.35467130e-03  5.02880167e+08 -1.80158225e-01
 -1.99749693e-03  1.80619014e-02 -1.44760683e-02 -1.41290780e-02
 -8.34795431e+08 -1.26528181e-02  7.60811340e+08  4.72815812e-01
 -4.32543457e-04 -5.92859462e-04  4.31454740e-04 -2.16336921e-04
 -3.31010669e-04 -2.15161592e-04 -1.63820572e-04 -8.88444483e-05
  6.64774328e-04  2.55461782e-04  5.99021092e-04  1.55138317e-04
  3.57009470e-04 -4.54422552e-04 -5.69013879e-04 -6.82063401e-04
 -5.65672293e-04  6.94105867e-04  2.25262716e-04 -3.78400087e-04
 -6.79403543e-04  1.48117542e-04  4.70077619e-04  1.46068633e-05
 -1.78450719e-03 -3.00404429e-03  2.74198316e-03 -4.17916104e-04
 -1.30403787e-04 -1.17681921e-04  1.23955309e-03  2.33393908e-03
  7.98057765e-04 -5.55988401e-04 -1.97822601e-03  2.24778429e-03
  9.08467919e-05 -7.57798553e-05  1.81981549e-03 -2.00450979e-03
 -3.15406546e-03 -5.66351973e-03  2.90933191e+08 -5.28128953e-02
 -3.21072634e+08 -6.03636376e-01 -1.83294853e+08  8.44726223e-01
 -3.47278482e+08  5.04561327e-03  5.61183222e+07 -3.77563387e-03
 -3.58220901e+08  5.76590672e-02  2.65414736e+08 -2.56042853e-02
  9.34688393e+07 -1.64581435e+00 -8.73863724e+08  9.95124876e-01
  5.14246105e+08  2.69232988e-02 -3.54088843e-05 -6.97188079e-06
 -1.39476359e-03  1.21091641e-02  3.05553898e-03  1.01378933e-03
 -1.20602548e-03 -1.00100413e-04  1.29752606e-03 -6.65001571e-05
  2.63286754e-03  4.09756228e-03  1.64574012e-04  9.65138897e-05
  2.85319984e-05 -2.78608873e-04 -7.69028440e-04  2.88311392e-04
  3.05164233e-03  1.62302330e-03 -4.99407062e-04 -5.28521836e-04
 -1.76540762e-03  2.82354653e-04  1.61041319e-03 -5.39831817e-04
 -6.63969666e-04  1.62825733e-03 -3.86139378e-04 -4.97372821e-05
 -2.13696435e-03 -1.11355074e-03  2.92520970e-04 -2.71508470e-04
  8.33291560e-05  5.51383011e-04  5.49517572e-05 -8.99387524e-04
 -1.92902237e-03  2.63471156e-04 -2.01787427e-03  5.47098927e-04
  4.75287437e-03  2.32979655e-05 -1.61765143e-04 -4.68520448e-04
  5.63289970e-04  2.76416540e-04 -1.97694823e-03  1.69471279e-03
 -9.46354121e-05 -1.76105648e-04  1.78915262e-03  3.23541462e-05
  2.33054161e-05  4.70131636e-05  1.34656974e-02 -1.64756649e-02
  6.21721335e-03 -6.68330677e-03  4.00772691e-03 -5.05124032e-03
 -1.60918669e+05 -2.25273099e+05  2.75560892e+00 -7.24322610e-02
 -8.04407997e+00  1.80345116e-01  4.39857134e+00 -1.05086368e-01
 -7.72841657e+07  2.67670179e+00 -7.79964030e-05  1.41989440e-04
  5.85908410e+08 -2.36372760e+08 -3.88973875e+08  2.46040601e+08
 -7.93894042e+07 -7.93844439e+07  6.76234786e+07  5.30399462e+08
 -4.60655686e-01  9.54800285e-03  1.89510286e-02 -1.07686967e-04
  8.87437165e-03  5.30703925e-04  1.09641999e-03 -9.89402644e-04
  1.31660047e+08  2.26757506e+01 -1.74827360e+08 -9.69528705e+01
  1.38989136e+08  9.37246974e+01  2.28047130e+08 -1.24002793e-02
 -4.51970514e+08  1.77573613e-02  3.50800373e+08 -1.09964549e-02
  3.88414450e-02 -4.14879173e-02 -2.83458982e+08  2.31746739e-01
  4.37937677e-04  8.14113766e-04 -1.63009055e-02 -1.71709713e-02
  4.31237909e+07  7.53031261e-02 -1.14368990e+07 -2.09814034e-01
 -5.79290092e-04  3.48025933e-04  5.13102859e-05  4.69595194e-04
  5.82609326e-04 -3.34728509e-04 -1.08151697e-04 -4.05339524e-04
  1.70242041e-04  1.01359561e-04 -8.63801688e-05 -7.65771139e-04
 -2.49238685e-04  1.25181861e-04 -1.96946785e-04 -7.63842836e-05
 -5.63133508e-05  4.28296626e-05  2.79400498e-04 -5.25413547e-04
 -2.33098865e-04  4.47896309e-04 -7.36817718e-04  4.76781279e-04
 -2.96624377e-04 -3.17106256e-03  9.71117988e-04  1.11708045e-03
 -9.83774662e-04 -3.30153853e-04  9.23985988e-03 -9.73826088e-03
  3.13572586e-04  2.31659040e-04 -9.07392614e-03  1.40720280e-03
  7.20554963e-05 -3.00392509e-04 -6.78368099e-03 -4.56801988e-03
  2.91998312e-03  2.39097327e-03 -1.79739846e+08  5.55952955e-02
  3.44793685e+08  4.96307658e-02 -3.67253684e+08 -2.77184501e-01
  8.50978318e+07  7.90213235e-04 -1.15281738e+08 -8.10250640e-05
  1.84825199e+07 -1.49305463e-02 -3.72744568e+08 -4.25354913e-02
  2.88947553e+08  5.66416565e-01 -3.05309134e+08 -2.32664082e-01
  6.17188763e+08 -1.55461222e-01 -2.58110464e-04 -3.28820199e-04
  7.00112432e-04 -4.75697964e-03  5.36713749e-04  8.85460898e-03
  9.03290696e-04  5.27605414e-04 -5.18757850e-04 -1.93601474e-04
 -7.99672678e-04  3.87602113e-03  4.72556800e-04 -1.03782024e-03
  5.65238297e-04  5.32228500e-04  2.93800607e-03 -1.04389060e-03
  7.75189605e-03  2.39936728e-03 -2.26914417e-03 -2.87275761e-04
 -2.09900178e-03  2.94567086e-04  1.32662058e-03 -1.70119107e-04
 -1.07938051e-03 -6.77078962e-04  4.40768898e-04 -9.54102725e-05
 -5.07216901e-04 -1.51727814e-03 -1.06364489e-04  6.56111166e-04
  1.06427819e-04  6.80577010e-04 -3.14056873e-04  1.09440088e-03
 -2.06752494e-03 -8.77022743e-04  5.26526477e-03  2.11834721e-03
 -6.47418015e-03 -2.78832531e-03 -7.00398348e-04 -7.10269436e-04
 -1.61170959e-04  3.08081508e-06 -1.86529569e-03 -4.44613397e-05
  1.09211542e-05 -3.22155654e-04  2.04877555e-03  3.93580645e-04
 -5.79819083e-04  6.46566972e-04 -4.12782910e-03  5.99174108e-03
 -7.61861354e-03  8.57660547e-03  3.62806022e-03 -2.84300745e-03
 -6.38821926e+04  8.82228909e+04  3.58049703e+00 -7.42405821e-02
  2.38376074e-01 -2.03442611e-02 -3.09107400e-01  1.90193057e-02
 -2.82500000e+07 -2.94284438e+00  3.62894498e-04  2.31517479e-04
 -1.16249588e+08  6.22557977e+08 -1.94127721e+08  2.88146497e+08
 -4.39620157e+08  1.91783593e+08  2.82384558e+08  9.13197426e+07
  5.64981140e-01 -1.64119219e-02  1.45581588e-02 -5.27389348e-05
  6.34174049e-03 -3.42745613e-03 -3.35102901e-03  2.65965424e-03
 -2.69673272e+08  1.03001527e+01  1.98795357e+08  1.47285370e+02
 -1.60457035e+08 -2.63196674e+02 -3.92276175e+08  1.61441274e-02
  1.01167300e+08 -3.73200870e-02  1.95694508e+07  3.18813231e-02
 -1.92042366e-02  2.18161196e-02  2.84032488e+08 -4.77510955e-01
 -3.11491638e-03  5.95536875e-03 -4.04088572e-03 -3.38539761e-03
  3.05973037e+08 -5.74705862e-02  1.11678769e+08  9.90952712e-01
 -1.71770342e-04 -1.89806800e-04 -1.15001574e-04  4.02650796e-04
 -2.91088596e-04 -3.32625583e-04 -8.56917351e-04  8.16769898e-04
  4.90834936e-04 -4.63884324e-04  3.31852585e-04 -4.96966764e-04
  4.19577584e-04 -5.63133508e-04  4.18039039e-04  1.61416829e-05
  1.28729828e-03 -4.40614298e-04  3.68189067e-05 -4.76390123e-05
 -1.54921599e-03  1.14366226e-03  1.04306638e-03 -9.47734341e-04
 -3.92310321e-05 -4.48897481e-05  3.08420137e-03  1.43991783e-05
 -1.68686360e-03  4.35502268e-04 -6.24807179e-03 -1.90264732e-03
 -3.23191285e-04  2.48501077e-04  4.34424914e-03  6.84682280e-04
  7.95170199e-04 -1.95369124e-04  6.84965402e-04  5.83965331e-04
 -2.46786140e-03  4.89757676e-03 -5.18328132e+08  1.09250715e-01
  1.79601207e+08  3.62519262e-01 -2.47009983e+08  5.18836062e-02
 -4.17491373e+07 -1.04687922e-03 -1.85779460e+07  1.77665055e-03
  1.32070162e+08 -9.09690559e-03 -1.88515923e+08 -1.85406953e-03
  1.76285228e+08 -2.36321699e-01 -6.42166704e+08 -3.49990245e-01
  2.64162880e+08 -5.42632584e-01 -4.04356048e-04  6.41353428e-04
  1.96583569e-03 -1.00218542e-02 -2.08716840e-04  1.75200775e-02
 -5.42805530e-04  2.86944211e-04  1.42880157e-03  7.07386993e-04
  4.97370958e-04 -4.43143770e-04  1.90753490e-04  4.05076891e-04
  9.93933529e-04 -7.85485841e-04  1.24306977e-03  1.09615736e-04
 -3.57621815e-03 -2.88124196e-04  2.58515589e-04 -6.89113513e-04
 -3.31896730e-03  7.39726238e-05 -5.70341945e-04 -2.81434506e-04
 -2.98067927e-04  2.85591930e-04  5.95809892e-04 -1.63037702e-03
 -2.09925510e-03  7.47689977e-04  7.10783526e-04 -3.43123917e-04
  4.92839143e-04  3.08316201e-04  4.26768325e-04  9.22667794e-04
 -1.99169666e-03  8.67165625e-04  8.94172117e-04 -1.17521919e-03
  5.26542775e-03 -9.59337689e-04  3.52272764e-04  6.52877148e-04
 -1.61186606e-03  6.81344420e-04  1.19907595e-03 -4.04238701e-04
 -1.18480530e-04 -3.55364755e-04  1.24654919e-03 -3.22546810e-04
  1.86721236e-03 -1.33803114e-04  8.55335407e-03 -7.87111837e-03
  9.74478573e-03 -9.66214202e-03  9.27622616e-03 -1.15540028e-02
 -3.82076496e+04  3.30500619e+05 -3.28309132e+00  6.62801974e-02
  6.12602887e+00 -1.25332962e-01 -3.85327780e+00  8.61278027e-02
  4.61519744e-01 -3.01127065e-01  5.62573317e-04 -7.04266131e-05
 -2.03795091e+08  3.26931383e+08  3.71996679e+08 -7.22183056e+08
 -2.82384558e+08 -9.13197426e+07 -2.45863415e-01  1.87298656e-03
  2.38748454e-02  1.12282299e-03  1.04319006e-02 -9.96150076e-04
  3.41490656e-03  3.06953676e-03  8.38867947e-03 -1.46391243e-03
 -2.23602878e+07 -1.02882111e+01 -1.64056761e+08 -5.94880942e+01
 -1.39140906e+08  1.31203108e+02  2.38022836e+07  3.93006045e-02
  7.42691152e+06  1.08493103e-02  4.51356170e+07  4.94066365e-02
 -1.08511001e-02  4.10205126e-03  1.91970002e+08  2.61775924e-01
 -9.43323597e-04  4.52343503e-03 -6.39970042e-03 -5.78400958e-03
  1.56734623e+08  6.66545406e-02 -5.91931049e+08 -4.00250580e-01
  4.24778089e-04  5.40474430e-05  5.28376549e-05 -2.54702754e-04
  3.04075889e-04 -2.34063715e-04  1.62553042e-04 -3.27820890e-04
 -4.48601320e-04 -7.36340880e-05  3.05745751e-04  1.33980066e-05
  5.41724265e-04 -5.16455621e-04  3.23073938e-04  1.71296299e-04
  4.40615695e-04 -4.31347638e-04 -7.10375607e-05 -3.19455750e-04
 -7.05904327e-04  9.96874645e-04 -6.13827258e-04  6.39501959e-04
 -5.39699569e-04 -7.07104802e-04  1.06311589e-03 -2.10737064e-03
 -1.19427405e-03  2.00462714e-03 -2.93325726e-03 -4.14118171e-04
  4.14527953e-04  3.97972763e-04  8.52432102e-04 -4.15523723e-03
 -2.51466408e-04 -3.91051173e-04 -4.37567011e-04 -7.49830157e-04
  3.72385047e-03  3.94434109e-03  3.64448997e+08 -7.99464416e-02
  3.65861028e+08 -1.88737954e-01 -4.74268066e+08 -7.55061917e-02
  6.78573043e+07  5.66391274e-04 -1.01895521e+08 -3.61134112e-03
  6.75782746e+07 -4.83452156e-03  3.44988389e+08  3.84124294e-02
 -2.87154506e+08 -3.26753877e-01  7.33240256e+08  2.38411695e-01
 -5.63321193e+08  4.87546895e-01  1.74969807e-03 -3.10759991e-03
 -1.04537606e-03 -9.20918584e-03  1.68327987e-03  1.21587068e-02
 -1.62206125e-03 -3.72342765e-04  6.29968941e-04  9.71682370e-04
 -2.03307718e-04  7.73645937e-04 -9.34612006e-04  6.97683543e-04
 -4.10247594e-04 -1.08621828e-03  1.33115798e-04 -1.05115399e-03
 -3.01816501e-04  2.09816732e-03  7.41318567e-04  6.00114465e-04
 -6.33637421e-04  8.00475478e-04 -1.63827091e-04  2.63186172e-04
 -3.70287336e-04 -5.57564199e-04  4.41348180e-04  8.45052302e-04
 -1.06884167e-03  1.00009702e-03 -2.66503543e-04  7.26211816e-04
  3.33329663e-04  3.85753810e-05  1.17437262e-03 -1.31708384e-03
  8.22907314e-04 -8.98305327e-04 -1.73187815e-03  1.55647844e-03
  2.12565064e-04 -6.05812296e-03  9.02129337e-04  2.30273232e-04
  3.51615250e-04  3.25694680e-04 -3.63683328e-04 -9.16386954e-04
 -3.43021937e-04  5.69811091e-05  3.79960984e-04  4.59177420e-04
 -1.17439777e-04  2.15541571e-04 -1.45976511e-02  1.60959316e-02
 -4.56042588e-03  4.34851833e-03 -1.94329768e-02  2.18475163e-02
 -2.42662771e+05 -1.39027815e+05  1.69911600e+00 -4.18187603e-02
 -2.89512119e+00  6.85486030e-02  1.36955070e+00 -3.46447825e-02]
Model intercept: 0.004142097607368128

2.2 Feature selection for linear regression: Recursive Feature Elimination (RFE)

From above, we can notice that the overfitting occurs. To solve the overfitting, we will try to use fewer features.

Since there are there are too many features, it is too computational expensive to try all the combinations of features. Therefore, we need to select the most important features. We implement Recursive Feature Elimination (RFE) to select the most important features.

2.2.1 Visualization of feature importance

# Assuming `X.columns` contains the feature names and `lin_reg.coef_` contains the coefficients.
df_coef = pd.DataFrame({
    'feature': X.columns,
    'coef': np.abs(lin_reg.coef_)  # Taking absolute values of coefficients
})

df_coef['day'] = df_coef['feature'].str.extract(r'day-(\d+)').astype(float)
df_coef['base_feature'] = df_coef['feature'].str.replace(
    r'_day-\d+(?=\^2)|_day-\d+',
    '',
    regex=True
)

# Group by 'base_feature' and 'day' to ensure uniqueness.
df_coef_grouped = df_coef.groupby(['base_feature', 'day'])['coef'].mean().unstack()

# Plot heatmap.
plt.figure(figsize=(10, 30))
plt.imshow(
    df_coef_grouped,
    aspect='auto',
    cmap='viridis',
    interpolation='nearest'
)
plt.colorbar(label="Absolute Coefficient Value")
plt.xticks(
    ticks=np.arange(len(df_coef_grouped.columns)),
    labels=df_coef_grouped.columns,
    rotation=45
)
plt.yticks(
    ticks=np.arange(len(df_coef_grouped.index)),
    labels=df_coef_grouped.index
)
plt.xlabel("Day Lag")
plt.ylabel("Feature")
plt.title("Feature Importance Heatmap (Absolute Coefficients)")
plt.show()

# Since the 'LinearRegression' object doesn't have 'feature_names_in_', manually retrieve column names.
df_coef = pd.DataFrame({
    'feature': X.columns,
    'coef': lin_reg.coef_
})

chart = alt.Chart(df_coef).mark_bar().encode(
    x='coef',
    y=alt.Y('feature', sort='-x')  # Sort by descending coefficient values.
).properties(
    title='Coefficients'
)

chart
c:\ProgramData\anaconda3\Lib\site-packages\altair\utils\core.py:395: FutureWarning: the convert_dtype parameter is deprecated and will be removed in a future version.  Do ``ser.astype(object).apply()`` instead if you want ``convert_dtype=False``.
  col = df[col_name].apply(to_list_if_array, convert_dtype=False)

2.2.2 RFE Cross-Validation

We used RFECV to do RFE and Cross-Validation (CV) at the same time.

# Time Series Cross-Validation.
tscv = TimeSeriesSplit(n_splits=3)

step_lin_reg = 1

# Initialize RFECV.
selector_lin_reg_cv = RFECV(
    estimator=LinearRegression(n_jobs=-1),
    step=step_lin_reg,  # Remove 1 feature at each step.
    cv=tscv,          # Time series split.
    verbose=1,
    scoring='neg_mean_squared_error'  # Negative MSE for scoring.
)

# Train and automatically select the optimal number of features.
selector_lin_reg_cv.fit(X_train, y_train)

# Save the best model for later use.
best_model_reg_final = selector_lin_reg_cv.estimator
Fitting estimator with 880 features.
Fitting estimator with 879 features.
Fitting estimator with 878 features.
Fitting estimator with 877 features.
Fitting estimator with 876 features.
Fitting estimator with 875 features.
Fitting estimator with 874 features.
Fitting estimator with 873 features.
Fitting estimator with 872 features.
Fitting estimator with 871 features.
Fitting estimator with 870 features.
Fitting estimator with 869 features.
Fitting estimator with 868 features.
Fitting estimator with 867 features.
Fitting estimator with 866 features.
Fitting estimator with 865 features.
Fitting estimator with 864 features.
Fitting estimator with 863 features.
Fitting estimator with 862 features.
Fitting estimator with 861 features.
Fitting estimator with 860 features.
Fitting estimator with 859 features.
Fitting estimator with 858 features.
Fitting estimator with 857 features.
Fitting estimator with 856 features.
Fitting estimator with 855 features.
Fitting estimator with 854 features.
Fitting estimator with 853 features.
Fitting estimator with 852 features.
Fitting estimator with 851 features.
Fitting estimator with 850 features.
Fitting estimator with 849 features.
Fitting estimator with 848 features.
Fitting estimator with 847 features.
Fitting estimator with 846 features.
Fitting estimator with 845 features.
Fitting estimator with 844 features.
Fitting estimator with 843 features.
Fitting estimator with 842 features.
Fitting estimator with 841 features.
Fitting estimator with 840 features.
Fitting estimator with 839 features.
Fitting estimator with 838 features.
Fitting estimator with 837 features.
Fitting estimator with 836 features.
Fitting estimator with 835 features.
Fitting estimator with 834 features.
Fitting estimator with 833 features.
Fitting estimator with 832 features.
Fitting estimator with 831 features.
Fitting estimator with 830 features.
Fitting estimator with 829 features.
Fitting estimator with 828 features.
Fitting estimator with 827 features.
Fitting estimator with 826 features.
Fitting estimator with 825 features.
Fitting estimator with 824 features.
Fitting estimator with 823 features.
Fitting estimator with 822 features.
Fitting estimator with 821 features.
Fitting estimator with 820 features.
Fitting estimator with 819 features.
Fitting estimator with 818 features.
Fitting estimator with 817 features.
Fitting estimator with 816 features.
Fitting estimator with 815 features.
Fitting estimator with 814 features.
Fitting estimator with 813 features.
Fitting estimator with 812 features.
Fitting estimator with 811 features.
Fitting estimator with 810 features.
Fitting estimator with 809 features.
Fitting estimator with 808 features.
Fitting estimator with 807 features.
Fitting estimator with 806 features.
Fitting estimator with 805 features.
Fitting estimator with 804 features.
Fitting estimator with 803 features.
Fitting estimator with 802 features.
Fitting estimator with 801 features.
Fitting estimator with 800 features.
Fitting estimator with 799 features.
Fitting estimator with 798 features.
Fitting estimator with 797 features.
Fitting estimator with 796 features.
Fitting estimator with 795 features.
Fitting estimator with 794 features.
Fitting estimator with 793 features.
Fitting estimator with 792 features.
Fitting estimator with 791 features.
Fitting estimator with 790 features.
Fitting estimator with 789 features.
Fitting estimator with 788 features.
Fitting estimator with 787 features.
Fitting estimator with 786 features.
Fitting estimator with 785 features.
Fitting estimator with 784 features.
Fitting estimator with 783 features.
Fitting estimator with 782 features.
Fitting estimator with 781 features.
Fitting estimator with 780 features.
Fitting estimator with 779 features.
Fitting estimator with 778 features.
Fitting estimator with 777 features.
Fitting estimator with 776 features.
Fitting estimator with 775 features.
Fitting estimator with 774 features.
Fitting estimator with 773 features.
Fitting estimator with 772 features.
Fitting estimator with 771 features.
Fitting estimator with 770 features.
Fitting estimator with 769 features.
Fitting estimator with 768 features.
Fitting estimator with 767 features.
Fitting estimator with 766 features.
Fitting estimator with 765 features.
Fitting estimator with 764 features.
Fitting estimator with 763 features.
Fitting estimator with 762 features.
Fitting estimator with 761 features.
Fitting estimator with 760 features.
Fitting estimator with 759 features.
Fitting estimator with 758 features.
Fitting estimator with 757 features.
Fitting estimator with 756 features.
Fitting estimator with 755 features.
Fitting estimator with 754 features.
Fitting estimator with 753 features.
Fitting estimator with 752 features.
Fitting estimator with 751 features.
Fitting estimator with 750 features.
Fitting estimator with 749 features.
Fitting estimator with 748 features.
Fitting estimator with 747 features.
Fitting estimator with 746 features.
Fitting estimator with 745 features.
Fitting estimator with 744 features.
Fitting estimator with 743 features.
Fitting estimator with 742 features.
Fitting estimator with 741 features.
Fitting estimator with 740 features.
Fitting estimator with 739 features.
Fitting estimator with 738 features.
Fitting estimator with 737 features.
Fitting estimator with 736 features.
Fitting estimator with 735 features.
Fitting estimator with 734 features.
Fitting estimator with 733 features.
Fitting estimator with 732 features.
Fitting estimator with 731 features.
Fitting estimator with 730 features.
Fitting estimator with 729 features.
Fitting estimator with 728 features.
Fitting estimator with 727 features.
Fitting estimator with 726 features.
Fitting estimator with 725 features.
Fitting estimator with 724 features.
Fitting estimator with 723 features.
Fitting estimator with 722 features.
Fitting estimator with 721 features.
Fitting estimator with 720 features.
Fitting estimator with 719 features.
Fitting estimator with 718 features.
Fitting estimator with 717 features.
Fitting estimator with 716 features.
Fitting estimator with 715 features.
Fitting estimator with 714 features.
Fitting estimator with 713 features.
Fitting estimator with 712 features.
Fitting estimator with 711 features.
Fitting estimator with 710 features.
Fitting estimator with 709 features.
Fitting estimator with 708 features.
Fitting estimator with 707 features.
Fitting estimator with 706 features.
Fitting estimator with 705 features.
Fitting estimator with 704 features.
Fitting estimator with 703 features.
Fitting estimator with 702 features.
Fitting estimator with 701 features.
Fitting estimator with 700 features.
Fitting estimator with 699 features.
Fitting estimator with 698 features.
Fitting estimator with 697 features.
Fitting estimator with 696 features.
Fitting estimator with 695 features.
Fitting estimator with 694 features.
Fitting estimator with 693 features.
Fitting estimator with 692 features.
Fitting estimator with 691 features.
Fitting estimator with 690 features.
Fitting estimator with 689 features.
Fitting estimator with 688 features.
Fitting estimator with 687 features.
Fitting estimator with 686 features.
Fitting estimator with 685 features.
Fitting estimator with 684 features.
Fitting estimator with 683 features.
Fitting estimator with 682 features.
Fitting estimator with 681 features.
Fitting estimator with 680 features.
Fitting estimator with 679 features.
Fitting estimator with 678 features.
Fitting estimator with 677 features.
Fitting estimator with 676 features.
Fitting estimator with 675 features.
Fitting estimator with 674 features.
Fitting estimator with 673 features.
Fitting estimator with 672 features.
Fitting estimator with 671 features.
Fitting estimator with 670 features.
Fitting estimator with 669 features.
Fitting estimator with 668 features.
Fitting estimator with 667 features.
Fitting estimator with 666 features.
Fitting estimator with 665 features.
Fitting estimator with 664 features.
Fitting estimator with 663 features.
Fitting estimator with 662 features.
Fitting estimator with 661 features.
Fitting estimator with 660 features.
Fitting estimator with 659 features.
Fitting estimator with 658 features.
Fitting estimator with 657 features.
Fitting estimator with 656 features.
Fitting estimator with 655 features.
Fitting estimator with 654 features.
Fitting estimator with 653 features.
Fitting estimator with 652 features.
Fitting estimator with 651 features.
Fitting estimator with 650 features.
Fitting estimator with 649 features.
Fitting estimator with 648 features.
Fitting estimator with 647 features.
Fitting estimator with 646 features.
Fitting estimator with 645 features.
Fitting estimator with 644 features.
Fitting estimator with 643 features.
Fitting estimator with 642 features.
Fitting estimator with 641 features.
Fitting estimator with 640 features.
Fitting estimator with 639 features.
Fitting estimator with 638 features.
Fitting estimator with 637 features.
Fitting estimator with 636 features.
Fitting estimator with 635 features.
Fitting estimator with 634 features.
Fitting estimator with 633 features.
Fitting estimator with 632 features.
Fitting estimator with 631 features.
Fitting estimator with 630 features.
Fitting estimator with 629 features.
Fitting estimator with 628 features.
Fitting estimator with 627 features.
Fitting estimator with 626 features.
Fitting estimator with 625 features.
Fitting estimator with 624 features.
Fitting estimator with 623 features.
Fitting estimator with 622 features.
Fitting estimator with 621 features.
Fitting estimator with 620 features.
Fitting estimator with 619 features.
Fitting estimator with 618 features.
Fitting estimator with 617 features.
Fitting estimator with 616 features.
Fitting estimator with 615 features.
Fitting estimator with 614 features.
Fitting estimator with 613 features.
Fitting estimator with 612 features.
Fitting estimator with 611 features.
Fitting estimator with 610 features.
Fitting estimator with 609 features.
Fitting estimator with 608 features.
Fitting estimator with 607 features.
Fitting estimator with 606 features.
Fitting estimator with 605 features.
Fitting estimator with 604 features.
Fitting estimator with 603 features.
Fitting estimator with 602 features.
Fitting estimator with 601 features.
Fitting estimator with 600 features.
Fitting estimator with 599 features.
Fitting estimator with 598 features.
Fitting estimator with 597 features.
Fitting estimator with 596 features.
Fitting estimator with 595 features.
Fitting estimator with 594 features.
Fitting estimator with 593 features.
Fitting estimator with 592 features.
Fitting estimator with 591 features.
Fitting estimator with 590 features.
Fitting estimator with 589 features.
Fitting estimator with 588 features.
Fitting estimator with 587 features.
Fitting estimator with 586 features.
Fitting estimator with 585 features.
Fitting estimator with 584 features.
Fitting estimator with 583 features.
Fitting estimator with 582 features.
Fitting estimator with 581 features.
Fitting estimator with 580 features.
Fitting estimator with 579 features.
Fitting estimator with 578 features.
Fitting estimator with 577 features.
Fitting estimator with 576 features.
Fitting estimator with 575 features.
Fitting estimator with 574 features.
Fitting estimator with 573 features.
Fitting estimator with 572 features.
Fitting estimator with 571 features.
Fitting estimator with 570 features.
Fitting estimator with 569 features.
Fitting estimator with 568 features.
Fitting estimator with 567 features.
Fitting estimator with 566 features.
Fitting estimator with 565 features.
Fitting estimator with 564 features.
Fitting estimator with 563 features.
Fitting estimator with 562 features.
Fitting estimator with 561 features.
Fitting estimator with 560 features.
Fitting estimator with 559 features.
Fitting estimator with 558 features.
Fitting estimator with 557 features.
Fitting estimator with 556 features.
Fitting estimator with 555 features.
Fitting estimator with 554 features.
Fitting estimator with 553 features.
Fitting estimator with 552 features.
Fitting estimator with 551 features.
Fitting estimator with 550 features.
Fitting estimator with 549 features.
Fitting estimator with 548 features.
Fitting estimator with 547 features.
Fitting estimator with 546 features.
Fitting estimator with 545 features.
Fitting estimator with 544 features.
Fitting estimator with 543 features.
Fitting estimator with 542 features.
Fitting estimator with 541 features.
Fitting estimator with 540 features.
Fitting estimator with 539 features.
Fitting estimator with 538 features.
Fitting estimator with 537 features.
Fitting estimator with 536 features.
Fitting estimator with 535 features.
Fitting estimator with 534 features.
Fitting estimator with 533 features.
Fitting estimator with 532 features.
Fitting estimator with 531 features.
Fitting estimator with 530 features.
Fitting estimator with 529 features.
Fitting estimator with 528 features.
Fitting estimator with 527 features.
Fitting estimator with 526 features.
Fitting estimator with 525 features.
Fitting estimator with 524 features.
Fitting estimator with 523 features.
Fitting estimator with 522 features.
Fitting estimator with 521 features.
Fitting estimator with 520 features.
Fitting estimator with 519 features.
Fitting estimator with 518 features.
Fitting estimator with 517 features.
Fitting estimator with 516 features.
Fitting estimator with 515 features.
Fitting estimator with 514 features.
Fitting estimator with 513 features.
Fitting estimator with 512 features.
Fitting estimator with 511 features.
Fitting estimator with 510 features.
Fitting estimator with 509 features.
Fitting estimator with 508 features.
Fitting estimator with 507 features.
Fitting estimator with 506 features.
Fitting estimator with 505 features.
Fitting estimator with 504 features.
Fitting estimator with 503 features.
Fitting estimator with 502 features.
Fitting estimator with 501 features.
Fitting estimator with 500 features.
Fitting estimator with 499 features.
Fitting estimator with 498 features.
Fitting estimator with 497 features.
Fitting estimator with 496 features.
Fitting estimator with 495 features.
Fitting estimator with 494 features.
Fitting estimator with 493 features.
Fitting estimator with 492 features.
Fitting estimator with 491 features.
Fitting estimator with 490 features.
Fitting estimator with 489 features.
Fitting estimator with 488 features.
Fitting estimator with 487 features.
Fitting estimator with 486 features.
Fitting estimator with 485 features.
Fitting estimator with 484 features.
Fitting estimator with 483 features.
Fitting estimator with 482 features.
Fitting estimator with 481 features.
Fitting estimator with 480 features.
Fitting estimator with 479 features.
Fitting estimator with 478 features.
Fitting estimator with 477 features.
Fitting estimator with 476 features.
Fitting estimator with 475 features.
Fitting estimator with 474 features.
Fitting estimator with 473 features.
Fitting estimator with 472 features.
Fitting estimator with 471 features.
Fitting estimator with 470 features.
Fitting estimator with 469 features.
Fitting estimator with 468 features.
Fitting estimator with 467 features.
Fitting estimator with 466 features.
Fitting estimator with 465 features.
Fitting estimator with 464 features.
Fitting estimator with 463 features.
Fitting estimator with 462 features.
Fitting estimator with 461 features.
Fitting estimator with 460 features.
Fitting estimator with 459 features.
Fitting estimator with 458 features.
Fitting estimator with 457 features.
Fitting estimator with 456 features.
Fitting estimator with 455 features.
Fitting estimator with 454 features.
Fitting estimator with 453 features.
Fitting estimator with 452 features.
Fitting estimator with 451 features.
Fitting estimator with 450 features.
Fitting estimator with 449 features.
Fitting estimator with 448 features.
Fitting estimator with 447 features.
Fitting estimator with 446 features.
Fitting estimator with 445 features.
Fitting estimator with 444 features.
Fitting estimator with 443 features.
Fitting estimator with 442 features.
Fitting estimator with 441 features.
Fitting estimator with 440 features.
Fitting estimator with 439 features.
Fitting estimator with 438 features.
Fitting estimator with 437 features.
Fitting estimator with 436 features.
Fitting estimator with 435 features.
Fitting estimator with 434 features.
Fitting estimator with 433 features.
Fitting estimator with 432 features.
Fitting estimator with 431 features.
Fitting estimator with 430 features.
Fitting estimator with 429 features.
Fitting estimator with 428 features.
Fitting estimator with 427 features.
Fitting estimator with 426 features.
Fitting estimator with 425 features.
Fitting estimator with 424 features.
Fitting estimator with 423 features.
Fitting estimator with 422 features.
Fitting estimator with 421 features.
Fitting estimator with 420 features.
Fitting estimator with 419 features.
Fitting estimator with 418 features.
Fitting estimator with 417 features.
Fitting estimator with 416 features.
Fitting estimator with 415 features.
Fitting estimator with 414 features.
Fitting estimator with 413 features.
Fitting estimator with 412 features.
Fitting estimator with 411 features.
Fitting estimator with 410 features.
Fitting estimator with 409 features.
Fitting estimator with 408 features.
Fitting estimator with 407 features.
Fitting estimator with 406 features.
Fitting estimator with 405 features.
Fitting estimator with 404 features.
Fitting estimator with 403 features.
Fitting estimator with 402 features.
Fitting estimator with 401 features.
Fitting estimator with 400 features.
Fitting estimator with 399 features.
Fitting estimator with 398 features.
Fitting estimator with 397 features.
Fitting estimator with 396 features.
Fitting estimator with 395 features.
Fitting estimator with 394 features.
Fitting estimator with 393 features.
Fitting estimator with 392 features.
Fitting estimator with 391 features.
Fitting estimator with 390 features.
Fitting estimator with 389 features.
Fitting estimator with 388 features.
Fitting estimator with 387 features.
Fitting estimator with 386 features.
Fitting estimator with 385 features.
Fitting estimator with 384 features.
Fitting estimator with 383 features.
Fitting estimator with 382 features.
Fitting estimator with 381 features.
Fitting estimator with 380 features.
Fitting estimator with 379 features.
Fitting estimator with 378 features.
Fitting estimator with 377 features.
Fitting estimator with 376 features.
Fitting estimator with 375 features.
Fitting estimator with 374 features.
Fitting estimator with 373 features.
Fitting estimator with 372 features.
Fitting estimator with 371 features.
Fitting estimator with 370 features.
Fitting estimator with 369 features.
Fitting estimator with 368 features.
Fitting estimator with 367 features.
Fitting estimator with 366 features.
Fitting estimator with 365 features.
Fitting estimator with 364 features.
Fitting estimator with 363 features.
Fitting estimator with 362 features.
Fitting estimator with 361 features.
Fitting estimator with 360 features.
Fitting estimator with 359 features.
Fitting estimator with 358 features.
Fitting estimator with 357 features.
Fitting estimator with 356 features.
Fitting estimator with 355 features.
Fitting estimator with 354 features.
Fitting estimator with 353 features.
Fitting estimator with 352 features.
Fitting estimator with 351 features.
Fitting estimator with 350 features.
Fitting estimator with 349 features.
Fitting estimator with 348 features.
Fitting estimator with 347 features.
Fitting estimator with 346 features.
Fitting estimator with 345 features.
Fitting estimator with 344 features.
Fitting estimator with 343 features.
Fitting estimator with 342 features.
Fitting estimator with 341 features.
Fitting estimator with 340 features.
Fitting estimator with 339 features.
Fitting estimator with 338 features.
Fitting estimator with 337 features.
Fitting estimator with 336 features.
Fitting estimator with 335 features.
Fitting estimator with 334 features.
Fitting estimator with 333 features.
Fitting estimator with 332 features.
Fitting estimator with 331 features.
Fitting estimator with 330 features.
Fitting estimator with 329 features.
Fitting estimator with 328 features.
Fitting estimator with 327 features.
Fitting estimator with 326 features.
Fitting estimator with 325 features.
Fitting estimator with 324 features.
Fitting estimator with 323 features.
Fitting estimator with 322 features.
Fitting estimator with 321 features.
Fitting estimator with 320 features.
Fitting estimator with 319 features.
Fitting estimator with 318 features.
Fitting estimator with 317 features.
Fitting estimator with 316 features.
Fitting estimator with 315 features.
Fitting estimator with 314 features.
Fitting estimator with 313 features.
Fitting estimator with 312 features.
Fitting estimator with 311 features.
Fitting estimator with 310 features.
Fitting estimator with 309 features.
Fitting estimator with 308 features.
Fitting estimator with 307 features.
Fitting estimator with 306 features.
Fitting estimator with 305 features.
Fitting estimator with 304 features.
Fitting estimator with 303 features.
Fitting estimator with 302 features.
Fitting estimator with 301 features.
Fitting estimator with 300 features.
Fitting estimator with 299 features.
Fitting estimator with 298 features.
Fitting estimator with 297 features.
Fitting estimator with 296 features.
Fitting estimator with 295 features.
Fitting estimator with 294 features.
Fitting estimator with 293 features.
Fitting estimator with 292 features.
Fitting estimator with 291 features.
Fitting estimator with 290 features.
Fitting estimator with 289 features.
Fitting estimator with 288 features.
Fitting estimator with 287 features.
Fitting estimator with 286 features.
Fitting estimator with 285 features.
Fitting estimator with 284 features.
Fitting estimator with 283 features.
Fitting estimator with 282 features.
Fitting estimator with 281 features.
Fitting estimator with 280 features.
Fitting estimator with 279 features.
Fitting estimator with 278 features.
Fitting estimator with 277 features.
Fitting estimator with 276 features.
Fitting estimator with 275 features.
Fitting estimator with 274 features.
Fitting estimator with 273 features.
Fitting estimator with 272 features.
Fitting estimator with 271 features.
Fitting estimator with 270 features.
Fitting estimator with 269 features.
Fitting estimator with 268 features.
Fitting estimator with 267 features.
Fitting estimator with 266 features.
Fitting estimator with 265 features.
Fitting estimator with 264 features.
Fitting estimator with 263 features.
Fitting estimator with 262 features.
Fitting estimator with 261 features.
Fitting estimator with 260 features.
Fitting estimator with 259 features.
Fitting estimator with 258 features.
Fitting estimator with 257 features.
Fitting estimator with 256 features.
Fitting estimator with 255 features.
Fitting estimator with 254 features.
Fitting estimator with 253 features.
Fitting estimator with 252 features.
Fitting estimator with 251 features.
Fitting estimator with 250 features.
Fitting estimator with 249 features.
Fitting estimator with 248 features.
Fitting estimator with 247 features.
Fitting estimator with 246 features.
Fitting estimator with 245 features.
Fitting estimator with 244 features.
Fitting estimator with 243 features.
Fitting estimator with 242 features.
Fitting estimator with 241 features.
Fitting estimator with 240 features.
Fitting estimator with 239 features.
Fitting estimator with 238 features.
Fitting estimator with 237 features.
Fitting estimator with 236 features.
Fitting estimator with 235 features.
Fitting estimator with 234 features.
Fitting estimator with 233 features.
Fitting estimator with 232 features.
Fitting estimator with 231 features.
Fitting estimator with 230 features.
Fitting estimator with 229 features.
Fitting estimator with 228 features.
Fitting estimator with 227 features.
Fitting estimator with 226 features.
Fitting estimator with 225 features.
Fitting estimator with 224 features.
Fitting estimator with 223 features.
Fitting estimator with 222 features.
Fitting estimator with 221 features.
Fitting estimator with 220 features.
Fitting estimator with 219 features.
Fitting estimator with 218 features.
Fitting estimator with 217 features.
Fitting estimator with 216 features.
Fitting estimator with 215 features.
Fitting estimator with 214 features.
Fitting estimator with 213 features.
Fitting estimator with 212 features.
Fitting estimator with 211 features.
Fitting estimator with 210 features.
Fitting estimator with 209 features.
Fitting estimator with 208 features.
Fitting estimator with 207 features.
Fitting estimator with 206 features.
Fitting estimator with 205 features.
Fitting estimator with 204 features.
Fitting estimator with 203 features.
Fitting estimator with 202 features.
Fitting estimator with 201 features.
Fitting estimator with 200 features.
Fitting estimator with 199 features.
Fitting estimator with 198 features.
Fitting estimator with 197 features.
Fitting estimator with 196 features.
Fitting estimator with 195 features.
Fitting estimator with 194 features.
Fitting estimator with 193 features.
Fitting estimator with 192 features.
Fitting estimator with 191 features.
Fitting estimator with 190 features.
Fitting estimator with 189 features.
Fitting estimator with 188 features.
Fitting estimator with 187 features.
Fitting estimator with 186 features.
Fitting estimator with 185 features.
Fitting estimator with 184 features.
Fitting estimator with 183 features.
Fitting estimator with 182 features.
Fitting estimator with 181 features.
Fitting estimator with 180 features.
Fitting estimator with 179 features.
Fitting estimator with 178 features.
Fitting estimator with 177 features.
Fitting estimator with 176 features.
Fitting estimator with 175 features.
Fitting estimator with 174 features.
Fitting estimator with 173 features.
Fitting estimator with 172 features.
Fitting estimator with 171 features.
Fitting estimator with 170 features.
Fitting estimator with 169 features.
Fitting estimator with 168 features.
Fitting estimator with 167 features.
Fitting estimator with 166 features.
Fitting estimator with 165 features.
Fitting estimator with 164 features.
Fitting estimator with 163 features.
Fitting estimator with 162 features.
Fitting estimator with 161 features.
Fitting estimator with 160 features.
Fitting estimator with 159 features.
Fitting estimator with 158 features.
Fitting estimator with 157 features.
Fitting estimator with 156 features.
Fitting estimator with 155 features.
Fitting estimator with 154 features.
Fitting estimator with 153 features.
Fitting estimator with 152 features.
Fitting estimator with 151 features.
Fitting estimator with 150 features.
Fitting estimator with 149 features.
Fitting estimator with 148 features.
Fitting estimator with 147 features.
Fitting estimator with 146 features.
Fitting estimator with 145 features.
Fitting estimator with 144 features.
Fitting estimator with 143 features.
Fitting estimator with 142 features.
Fitting estimator with 141 features.
Fitting estimator with 140 features.
Fitting estimator with 139 features.
Fitting estimator with 138 features.
Fitting estimator with 137 features.
Fitting estimator with 136 features.
Fitting estimator with 135 features.
Fitting estimator with 134 features.
Fitting estimator with 133 features.
Fitting estimator with 132 features.
Fitting estimator with 131 features.
Fitting estimator with 130 features.
Fitting estimator with 129 features.
Fitting estimator with 128 features.
Fitting estimator with 127 features.
Fitting estimator with 126 features.
Fitting estimator with 125 features.
Fitting estimator with 124 features.
Fitting estimator with 123 features.
Fitting estimator with 122 features.
Fitting estimator with 121 features.
Fitting estimator with 120 features.
Fitting estimator with 119 features.
Fitting estimator with 118 features.
Fitting estimator with 117 features.
Fitting estimator with 116 features.
Fitting estimator with 115 features.
Fitting estimator with 114 features.
Fitting estimator with 113 features.
Fitting estimator with 112 features.
Fitting estimator with 111 features.
Fitting estimator with 110 features.
Fitting estimator with 109 features.
Fitting estimator with 108 features.
Fitting estimator with 107 features.
Fitting estimator with 106 features.
Fitting estimator with 105 features.
Fitting estimator with 104 features.
Fitting estimator with 103 features.
Fitting estimator with 102 features.
Fitting estimator with 101 features.
Fitting estimator with 100 features.
Fitting estimator with 99 features.
Fitting estimator with 98 features.
Fitting estimator with 97 features.
Fitting estimator with 96 features.
Fitting estimator with 95 features.
Fitting estimator with 94 features.
Fitting estimator with 93 features.
Fitting estimator with 92 features.
Fitting estimator with 91 features.
Fitting estimator with 90 features.
Fitting estimator with 89 features.
Fitting estimator with 88 features.
Fitting estimator with 87 features.
Fitting estimator with 86 features.
Fitting estimator with 85 features.
Fitting estimator with 84 features.
Fitting estimator with 83 features.
Fitting estimator with 82 features.
Fitting estimator with 81 features.
Fitting estimator with 80 features.
Fitting estimator with 79 features.
Fitting estimator with 78 features.
Fitting estimator with 77 features.
Fitting estimator with 76 features.
Fitting estimator with 75 features.
Fitting estimator with 74 features.
Fitting estimator with 73 features.
Fitting estimator with 72 features.
Fitting estimator with 71 features.
Fitting estimator with 70 features.
Fitting estimator with 69 features.
Fitting estimator with 68 features.
Fitting estimator with 67 features.
Fitting estimator with 66 features.
Fitting estimator with 65 features.
Fitting estimator with 64 features.
Fitting estimator with 63 features.
Fitting estimator with 62 features.
Fitting estimator with 61 features.
Fitting estimator with 60 features.
Fitting estimator with 59 features.
Fitting estimator with 58 features.
Fitting estimator with 57 features.
Fitting estimator with 56 features.
Fitting estimator with 55 features.
Fitting estimator with 54 features.
Fitting estimator with 53 features.
Fitting estimator with 52 features.
Fitting estimator with 51 features.
Fitting estimator with 50 features.
Fitting estimator with 49 features.
Fitting estimator with 48 features.
Fitting estimator with 47 features.
Fitting estimator with 46 features.
Fitting estimator with 45 features.
Fitting estimator with 44 features.
Fitting estimator with 43 features.
Fitting estimator with 42 features.
Fitting estimator with 41 features.
Fitting estimator with 40 features.
Fitting estimator with 39 features.
Fitting estimator with 38 features.
Fitting estimator with 37 features.
Fitting estimator with 36 features.
Fitting estimator with 35 features.
Fitting estimator with 34 features.
Fitting estimator with 33 features.
Fitting estimator with 32 features.
Fitting estimator with 31 features.
Fitting estimator with 30 features.
Fitting estimator with 29 features.
Fitting estimator with 28 features.
Fitting estimator with 27 features.
Fitting estimator with 26 features.
Fitting estimator with 25 features.
Fitting estimator with 24 features.
Fitting estimator with 23 features.
Fitting estimator with 22 features.
Fitting estimator with 21 features.
Fitting estimator with 20 features.
Fitting estimator with 19 features.
Fitting estimator with 18 features.
Fitting estimator with 17 features.
Fitting estimator with 16 features.
Fitting estimator with 15 features.
Fitting estimator with 14 features.
Fitting estimator with 13 features.
Fitting estimator with 12 features.
Fitting estimator with 11 features.
Fitting estimator with 10 features.
Fitting estimator with 9 features.
Fitting estimator with 8 features.
Fitting estimator with 7 features.
Fitting estimator with 6 features.
Fitting estimator with 5 features.
Fitting estimator with 4 features.
Fitting estimator with 3 features.
Fitting estimator with 2 features.
Fitting estimator with 880 features.
Fitting estimator with 879 features.
Fitting estimator with 878 features.
Fitting estimator with 877 features.
Fitting estimator with 876 features.
Fitting estimator with 875 features.
Fitting estimator with 874 features.
Fitting estimator with 873 features.
Fitting estimator with 872 features.
Fitting estimator with 871 features.
Fitting estimator with 870 features.
Fitting estimator with 869 features.
Fitting estimator with 868 features.
Fitting estimator with 867 features.
Fitting estimator with 866 features.
Fitting estimator with 865 features.
Fitting estimator with 864 features.
Fitting estimator with 863 features.
Fitting estimator with 862 features.
Fitting estimator with 861 features.
Fitting estimator with 860 features.
Fitting estimator with 859 features.
Fitting estimator with 858 features.
Fitting estimator with 857 features.
Fitting estimator with 856 features.
Fitting estimator with 855 features.
Fitting estimator with 854 features.
Fitting estimator with 853 features.
Fitting estimator with 852 features.
Fitting estimator with 851 features.
Fitting estimator with 850 features.
Fitting estimator with 849 features.
Fitting estimator with 848 features.
Fitting estimator with 847 features.
Fitting estimator with 846 features.
Fitting estimator with 845 features.
Fitting estimator with 844 features.
Fitting estimator with 843 features.
Fitting estimator with 842 features.
Fitting estimator with 841 features.
Fitting estimator with 840 features.
Fitting estimator with 839 features.
Fitting estimator with 838 features.
Fitting estimator with 837 features.
Fitting estimator with 836 features.
Fitting estimator with 835 features.
Fitting estimator with 834 features.
Fitting estimator with 833 features.
Fitting estimator with 832 features.
Fitting estimator with 831 features.
Fitting estimator with 830 features.
Fitting estimator with 829 features.
Fitting estimator with 828 features.
Fitting estimator with 827 features.
Fitting estimator with 826 features.
Fitting estimator with 825 features.
Fitting estimator with 824 features.
Fitting estimator with 823 features.
Fitting estimator with 822 features.
Fitting estimator with 821 features.
Fitting estimator with 820 features.
Fitting estimator with 819 features.
Fitting estimator with 818 features.
Fitting estimator with 817 features.
Fitting estimator with 816 features.
Fitting estimator with 815 features.
Fitting estimator with 814 features.
Fitting estimator with 813 features.
Fitting estimator with 812 features.
Fitting estimator with 811 features.
Fitting estimator with 810 features.
Fitting estimator with 809 features.
Fitting estimator with 808 features.
Fitting estimator with 807 features.
Fitting estimator with 806 features.
Fitting estimator with 805 features.
Fitting estimator with 804 features.
Fitting estimator with 803 features.
Fitting estimator with 802 features.
Fitting estimator with 801 features.
Fitting estimator with 800 features.
Fitting estimator with 799 features.
Fitting estimator with 798 features.
Fitting estimator with 797 features.
Fitting estimator with 796 features.
Fitting estimator with 795 features.
Fitting estimator with 794 features.
Fitting estimator with 793 features.
Fitting estimator with 792 features.
Fitting estimator with 791 features.
Fitting estimator with 790 features.
Fitting estimator with 789 features.
Fitting estimator with 788 features.
Fitting estimator with 787 features.
Fitting estimator with 786 features.
Fitting estimator with 785 features.
Fitting estimator with 784 features.
Fitting estimator with 783 features.
Fitting estimator with 782 features.
Fitting estimator with 781 features.
Fitting estimator with 780 features.
Fitting estimator with 779 features.
Fitting estimator with 778 features.
Fitting estimator with 777 features.
Fitting estimator with 776 features.
Fitting estimator with 775 features.
Fitting estimator with 774 features.
Fitting estimator with 773 features.
Fitting estimator with 772 features.
Fitting estimator with 771 features.
Fitting estimator with 770 features.
Fitting estimator with 769 features.
Fitting estimator with 768 features.
Fitting estimator with 767 features.
Fitting estimator with 766 features.
Fitting estimator with 765 features.
Fitting estimator with 764 features.
Fitting estimator with 763 features.
Fitting estimator with 762 features.
Fitting estimator with 761 features.
Fitting estimator with 760 features.
Fitting estimator with 759 features.
Fitting estimator with 758 features.
Fitting estimator with 757 features.
Fitting estimator with 756 features.
Fitting estimator with 755 features.
Fitting estimator with 754 features.
Fitting estimator with 753 features.
Fitting estimator with 752 features.
Fitting estimator with 751 features.
Fitting estimator with 750 features.
Fitting estimator with 749 features.
Fitting estimator with 748 features.
Fitting estimator with 747 features.
Fitting estimator with 746 features.
Fitting estimator with 745 features.
Fitting estimator with 744 features.
Fitting estimator with 743 features.
Fitting estimator with 742 features.
Fitting estimator with 741 features.
Fitting estimator with 740 features.
Fitting estimator with 739 features.
Fitting estimator with 738 features.
Fitting estimator with 737 features.
Fitting estimator with 736 features.
Fitting estimator with 735 features.
Fitting estimator with 734 features.
Fitting estimator with 733 features.
Fitting estimator with 732 features.
Fitting estimator with 731 features.
Fitting estimator with 730 features.
Fitting estimator with 729 features.
Fitting estimator with 728 features.
Fitting estimator with 727 features.
Fitting estimator with 726 features.
Fitting estimator with 725 features.
Fitting estimator with 724 features.
Fitting estimator with 723 features.
Fitting estimator with 722 features.
Fitting estimator with 721 features.
Fitting estimator with 720 features.
Fitting estimator with 719 features.
Fitting estimator with 718 features.
Fitting estimator with 717 features.
Fitting estimator with 716 features.
Fitting estimator with 715 features.
Fitting estimator with 714 features.
Fitting estimator with 713 features.
Fitting estimator with 712 features.
Fitting estimator with 711 features.
Fitting estimator with 710 features.
Fitting estimator with 709 features.
Fitting estimator with 708 features.
Fitting estimator with 707 features.
Fitting estimator with 706 features.
Fitting estimator with 705 features.
Fitting estimator with 704 features.
Fitting estimator with 703 features.
Fitting estimator with 702 features.
Fitting estimator with 701 features.
Fitting estimator with 700 features.
Fitting estimator with 699 features.
Fitting estimator with 698 features.
Fitting estimator with 697 features.
Fitting estimator with 696 features.
Fitting estimator with 695 features.
Fitting estimator with 694 features.
Fitting estimator with 693 features.
Fitting estimator with 692 features.
Fitting estimator with 691 features.
Fitting estimator with 690 features.
Fitting estimator with 689 features.
Fitting estimator with 688 features.
Fitting estimator with 687 features.
Fitting estimator with 686 features.
Fitting estimator with 685 features.
Fitting estimator with 684 features.
Fitting estimator with 683 features.
Fitting estimator with 682 features.
Fitting estimator with 681 features.
Fitting estimator with 680 features.
Fitting estimator with 679 features.
Fitting estimator with 678 features.
Fitting estimator with 677 features.
Fitting estimator with 676 features.
Fitting estimator with 675 features.
Fitting estimator with 674 features.
Fitting estimator with 673 features.
Fitting estimator with 672 features.
Fitting estimator with 671 features.
Fitting estimator with 670 features.
Fitting estimator with 669 features.
Fitting estimator with 668 features.
Fitting estimator with 667 features.
Fitting estimator with 666 features.
Fitting estimator with 665 features.
Fitting estimator with 664 features.
Fitting estimator with 663 features.
Fitting estimator with 662 features.
Fitting estimator with 661 features.
Fitting estimator with 660 features.
Fitting estimator with 659 features.
Fitting estimator with 658 features.
Fitting estimator with 657 features.
Fitting estimator with 656 features.
Fitting estimator with 655 features.
Fitting estimator with 654 features.
Fitting estimator with 653 features.
Fitting estimator with 652 features.
Fitting estimator with 651 features.
Fitting estimator with 650 features.
Fitting estimator with 649 features.
Fitting estimator with 648 features.
Fitting estimator with 647 features.
Fitting estimator with 646 features.
Fitting estimator with 645 features.
Fitting estimator with 644 features.
Fitting estimator with 643 features.
Fitting estimator with 642 features.
Fitting estimator with 641 features.
Fitting estimator with 640 features.
Fitting estimator with 639 features.
Fitting estimator with 638 features.
Fitting estimator with 637 features.
Fitting estimator with 636 features.
Fitting estimator with 635 features.
Fitting estimator with 634 features.
Fitting estimator with 633 features.
Fitting estimator with 632 features.
Fitting estimator with 631 features.
Fitting estimator with 630 features.
Fitting estimator with 629 features.
Fitting estimator with 628 features.
Fitting estimator with 627 features.
Fitting estimator with 626 features.
Fitting estimator with 625 features.
Fitting estimator with 624 features.
Fitting estimator with 623 features.
Fitting estimator with 622 features.
Fitting estimator with 621 features.
Fitting estimator with 620 features.
Fitting estimator with 619 features.
Fitting estimator with 618 features.
Fitting estimator with 617 features.
Fitting estimator with 616 features.
Fitting estimator with 615 features.
Fitting estimator with 614 features.
Fitting estimator with 613 features.
Fitting estimator with 612 features.
Fitting estimator with 611 features.
Fitting estimator with 610 features.
Fitting estimator with 609 features.
Fitting estimator with 608 features.
Fitting estimator with 607 features.
Fitting estimator with 606 features.
Fitting estimator with 605 features.
Fitting estimator with 604 features.
Fitting estimator with 603 features.
Fitting estimator with 602 features.
Fitting estimator with 601 features.
Fitting estimator with 600 features.
Fitting estimator with 599 features.
Fitting estimator with 598 features.
Fitting estimator with 597 features.
Fitting estimator with 596 features.
Fitting estimator with 595 features.
Fitting estimator with 594 features.
Fitting estimator with 593 features.
Fitting estimator with 592 features.
Fitting estimator with 591 features.
Fitting estimator with 590 features.
Fitting estimator with 589 features.
Fitting estimator with 588 features.
Fitting estimator with 587 features.
Fitting estimator with 586 features.
Fitting estimator with 585 features.
Fitting estimator with 584 features.
Fitting estimator with 583 features.
Fitting estimator with 582 features.
Fitting estimator with 581 features.
Fitting estimator with 580 features.
Fitting estimator with 579 features.
Fitting estimator with 578 features.
Fitting estimator with 577 features.
Fitting estimator with 576 features.
Fitting estimator with 575 features.
Fitting estimator with 574 features.
Fitting estimator with 573 features.
Fitting estimator with 572 features.
Fitting estimator with 571 features.
Fitting estimator with 570 features.
Fitting estimator with 569 features.
Fitting estimator with 568 features.
Fitting estimator with 567 features.
Fitting estimator with 566 features.
Fitting estimator with 565 features.
Fitting estimator with 564 features.
Fitting estimator with 563 features.
Fitting estimator with 562 features.
Fitting estimator with 561 features.
Fitting estimator with 560 features.
Fitting estimator with 559 features.
Fitting estimator with 558 features.
Fitting estimator with 557 features.
Fitting estimator with 556 features.
Fitting estimator with 555 features.
Fitting estimator with 554 features.
Fitting estimator with 553 features.
Fitting estimator with 552 features.
Fitting estimator with 551 features.
Fitting estimator with 550 features.
Fitting estimator with 549 features.
Fitting estimator with 548 features.
Fitting estimator with 547 features.
Fitting estimator with 546 features.
Fitting estimator with 545 features.
Fitting estimator with 544 features.
Fitting estimator with 543 features.
Fitting estimator with 542 features.
Fitting estimator with 541 features.
Fitting estimator with 540 features.
Fitting estimator with 539 features.
Fitting estimator with 538 features.
Fitting estimator with 537 features.
Fitting estimator with 536 features.
Fitting estimator with 535 features.
Fitting estimator with 534 features.
Fitting estimator with 533 features.
Fitting estimator with 532 features.
Fitting estimator with 531 features.
Fitting estimator with 530 features.
Fitting estimator with 529 features.
Fitting estimator with 528 features.
Fitting estimator with 527 features.
Fitting estimator with 526 features.
Fitting estimator with 525 features.
Fitting estimator with 524 features.
Fitting estimator with 523 features.
Fitting estimator with 522 features.
Fitting estimator with 521 features.
Fitting estimator with 520 features.
Fitting estimator with 519 features.
Fitting estimator with 518 features.
Fitting estimator with 517 features.
Fitting estimator with 516 features.
Fitting estimator with 515 features.
Fitting estimator with 514 features.
Fitting estimator with 513 features.
Fitting estimator with 512 features.
Fitting estimator with 511 features.
Fitting estimator with 510 features.
Fitting estimator with 509 features.
Fitting estimator with 508 features.
Fitting estimator with 507 features.
Fitting estimator with 506 features.
Fitting estimator with 505 features.
Fitting estimator with 504 features.
Fitting estimator with 503 features.
Fitting estimator with 502 features.
Fitting estimator with 501 features.
Fitting estimator with 500 features.
Fitting estimator with 499 features.
Fitting estimator with 498 features.
Fitting estimator with 497 features.
Fitting estimator with 496 features.
Fitting estimator with 495 features.
Fitting estimator with 494 features.
Fitting estimator with 493 features.
Fitting estimator with 492 features.
Fitting estimator with 491 features.
Fitting estimator with 490 features.
Fitting estimator with 489 features.
Fitting estimator with 488 features.
Fitting estimator with 487 features.
Fitting estimator with 486 features.
Fitting estimator with 485 features.
Fitting estimator with 484 features.
Fitting estimator with 483 features.
Fitting estimator with 482 features.
Fitting estimator with 481 features.
Fitting estimator with 480 features.
Fitting estimator with 479 features.
Fitting estimator with 478 features.
Fitting estimator with 477 features.
Fitting estimator with 476 features.
Fitting estimator with 475 features.
Fitting estimator with 474 features.
Fitting estimator with 473 features.
Fitting estimator with 472 features.
Fitting estimator with 471 features.
Fitting estimator with 470 features.
Fitting estimator with 469 features.
Fitting estimator with 468 features.
Fitting estimator with 467 features.
Fitting estimator with 466 features.
Fitting estimator with 465 features.
Fitting estimator with 464 features.
Fitting estimator with 463 features.
Fitting estimator with 462 features.
Fitting estimator with 461 features.
Fitting estimator with 460 features.
Fitting estimator with 459 features.
Fitting estimator with 458 features.
Fitting estimator with 457 features.
Fitting estimator with 456 features.
Fitting estimator with 455 features.
Fitting estimator with 454 features.
Fitting estimator with 453 features.
Fitting estimator with 452 features.
Fitting estimator with 451 features.
Fitting estimator with 450 features.
Fitting estimator with 449 features.
Fitting estimator with 448 features.
Fitting estimator with 447 features.
Fitting estimator with 446 features.
Fitting estimator with 445 features.
Fitting estimator with 444 features.
Fitting estimator with 443 features.
Fitting estimator with 442 features.
Fitting estimator with 441 features.
Fitting estimator with 440 features.
Fitting estimator with 439 features.
Fitting estimator with 438 features.
Fitting estimator with 437 features.
Fitting estimator with 436 features.
Fitting estimator with 435 features.
Fitting estimator with 434 features.
Fitting estimator with 433 features.
Fitting estimator with 432 features.
Fitting estimator with 431 features.
Fitting estimator with 430 features.
Fitting estimator with 429 features.
Fitting estimator with 428 features.
Fitting estimator with 427 features.
Fitting estimator with 426 features.
Fitting estimator with 425 features.
Fitting estimator with 424 features.
Fitting estimator with 423 features.
Fitting estimator with 422 features.
Fitting estimator with 421 features.
Fitting estimator with 420 features.
Fitting estimator with 419 features.
Fitting estimator with 418 features.
Fitting estimator with 417 features.
Fitting estimator with 416 features.
Fitting estimator with 415 features.
Fitting estimator with 414 features.
Fitting estimator with 413 features.
Fitting estimator with 412 features.
Fitting estimator with 411 features.
Fitting estimator with 410 features.
Fitting estimator with 409 features.
Fitting estimator with 408 features.
Fitting estimator with 407 features.
Fitting estimator with 406 features.
Fitting estimator with 405 features.
Fitting estimator with 404 features.
Fitting estimator with 403 features.
Fitting estimator with 402 features.
Fitting estimator with 401 features.
Fitting estimator with 400 features.
Fitting estimator with 399 features.
Fitting estimator with 398 features.
Fitting estimator with 397 features.
Fitting estimator with 396 features.
Fitting estimator with 395 features.
Fitting estimator with 394 features.
Fitting estimator with 393 features.
Fitting estimator with 392 features.
Fitting estimator with 391 features.
Fitting estimator with 390 features.
Fitting estimator with 389 features.
Fitting estimator with 388 features.
Fitting estimator with 387 features.
Fitting estimator with 386 features.
Fitting estimator with 385 features.
Fitting estimator with 384 features.
Fitting estimator with 383 features.
Fitting estimator with 382 features.
Fitting estimator with 381 features.
Fitting estimator with 380 features.
Fitting estimator with 379 features.
Fitting estimator with 378 features.
Fitting estimator with 377 features.
Fitting estimator with 376 features.
Fitting estimator with 375 features.
Fitting estimator with 374 features.
Fitting estimator with 373 features.
Fitting estimator with 372 features.
Fitting estimator with 371 features.
Fitting estimator with 370 features.
Fitting estimator with 369 features.
Fitting estimator with 368 features.
Fitting estimator with 367 features.
Fitting estimator with 366 features.
Fitting estimator with 365 features.
Fitting estimator with 364 features.
Fitting estimator with 363 features.
Fitting estimator with 362 features.
Fitting estimator with 361 features.
Fitting estimator with 360 features.
Fitting estimator with 359 features.
Fitting estimator with 358 features.
Fitting estimator with 357 features.
Fitting estimator with 356 features.
Fitting estimator with 355 features.
Fitting estimator with 354 features.
Fitting estimator with 353 features.
Fitting estimator with 352 features.
Fitting estimator with 351 features.
Fitting estimator with 350 features.
Fitting estimator with 349 features.
Fitting estimator with 348 features.
Fitting estimator with 347 features.
Fitting estimator with 346 features.
Fitting estimator with 345 features.
Fitting estimator with 344 features.
Fitting estimator with 343 features.
Fitting estimator with 342 features.
Fitting estimator with 341 features.
Fitting estimator with 340 features.
Fitting estimator with 339 features.
Fitting estimator with 338 features.
Fitting estimator with 337 features.
Fitting estimator with 336 features.
Fitting estimator with 335 features.
Fitting estimator with 334 features.
Fitting estimator with 333 features.
Fitting estimator with 332 features.
Fitting estimator with 331 features.
Fitting estimator with 330 features.
Fitting estimator with 329 features.
Fitting estimator with 328 features.
Fitting estimator with 327 features.
Fitting estimator with 326 features.
Fitting estimator with 325 features.
Fitting estimator with 324 features.
Fitting estimator with 323 features.
Fitting estimator with 322 features.
Fitting estimator with 321 features.
Fitting estimator with 320 features.
Fitting estimator with 319 features.
Fitting estimator with 318 features.
Fitting estimator with 317 features.
Fitting estimator with 316 features.
Fitting estimator with 315 features.
Fitting estimator with 314 features.
Fitting estimator with 313 features.
Fitting estimator with 312 features.
Fitting estimator with 311 features.
Fitting estimator with 310 features.
Fitting estimator with 309 features.
Fitting estimator with 308 features.
Fitting estimator with 307 features.
Fitting estimator with 306 features.
Fitting estimator with 305 features.
Fitting estimator with 304 features.
Fitting estimator with 303 features.
Fitting estimator with 302 features.
Fitting estimator with 301 features.
Fitting estimator with 300 features.
Fitting estimator with 299 features.
Fitting estimator with 298 features.
Fitting estimator with 297 features.
Fitting estimator with 296 features.
Fitting estimator with 295 features.
Fitting estimator with 294 features.
Fitting estimator with 293 features.
Fitting estimator with 292 features.
Fitting estimator with 291 features.
Fitting estimator with 290 features.
Fitting estimator with 289 features.
Fitting estimator with 288 features.
Fitting estimator with 287 features.
Fitting estimator with 286 features.
Fitting estimator with 285 features.
Fitting estimator with 284 features.
Fitting estimator with 283 features.
Fitting estimator with 282 features.
Fitting estimator with 281 features.
Fitting estimator with 280 features.
Fitting estimator with 279 features.
Fitting estimator with 278 features.
Fitting estimator with 277 features.
Fitting estimator with 276 features.
Fitting estimator with 275 features.
Fitting estimator with 274 features.
Fitting estimator with 273 features.
Fitting estimator with 272 features.
Fitting estimator with 271 features.
Fitting estimator with 270 features.
Fitting estimator with 269 features.
Fitting estimator with 268 features.
Fitting estimator with 267 features.
Fitting estimator with 266 features.
Fitting estimator with 265 features.
Fitting estimator with 264 features.
Fitting estimator with 263 features.
Fitting estimator with 262 features.
Fitting estimator with 261 features.
Fitting estimator with 260 features.
Fitting estimator with 259 features.
Fitting estimator with 258 features.
Fitting estimator with 257 features.
Fitting estimator with 256 features.
Fitting estimator with 255 features.
Fitting estimator with 254 features.
Fitting estimator with 253 features.
Fitting estimator with 252 features.
Fitting estimator with 251 features.
Fitting estimator with 250 features.
Fitting estimator with 249 features.
Fitting estimator with 248 features.
Fitting estimator with 247 features.
Fitting estimator with 246 features.
Fitting estimator with 245 features.
Fitting estimator with 244 features.
Fitting estimator with 243 features.
Fitting estimator with 242 features.
Fitting estimator with 241 features.
Fitting estimator with 240 features.
Fitting estimator with 239 features.
Fitting estimator with 238 features.
Fitting estimator with 237 features.
Fitting estimator with 236 features.
Fitting estimator with 235 features.
Fitting estimator with 234 features.
Fitting estimator with 233 features.
Fitting estimator with 232 features.
Fitting estimator with 231 features.
Fitting estimator with 230 features.
Fitting estimator with 229 features.
Fitting estimator with 228 features.
Fitting estimator with 227 features.
Fitting estimator with 226 features.
Fitting estimator with 225 features.
Fitting estimator with 224 features.
Fitting estimator with 223 features.
Fitting estimator with 222 features.
Fitting estimator with 221 features.
Fitting estimator with 220 features.
Fitting estimator with 219 features.
Fitting estimator with 218 features.
Fitting estimator with 217 features.
Fitting estimator with 216 features.
Fitting estimator with 215 features.
Fitting estimator with 214 features.
Fitting estimator with 213 features.
Fitting estimator with 212 features.
Fitting estimator with 211 features.
Fitting estimator with 210 features.
Fitting estimator with 209 features.
Fitting estimator with 208 features.
Fitting estimator with 207 features.
Fitting estimator with 206 features.
Fitting estimator with 205 features.
Fitting estimator with 204 features.
Fitting estimator with 203 features.
Fitting estimator with 202 features.
Fitting estimator with 201 features.
Fitting estimator with 200 features.
Fitting estimator with 199 features.
Fitting estimator with 198 features.
Fitting estimator with 197 features.
Fitting estimator with 196 features.
Fitting estimator with 195 features.
Fitting estimator with 194 features.
Fitting estimator with 193 features.
Fitting estimator with 192 features.
Fitting estimator with 191 features.
Fitting estimator with 190 features.
Fitting estimator with 189 features.
Fitting estimator with 188 features.
Fitting estimator with 187 features.
Fitting estimator with 186 features.
Fitting estimator with 185 features.
Fitting estimator with 184 features.
Fitting estimator with 183 features.
Fitting estimator with 182 features.
Fitting estimator with 181 features.
Fitting estimator with 180 features.
Fitting estimator with 179 features.
Fitting estimator with 178 features.
Fitting estimator with 177 features.
Fitting estimator with 176 features.
Fitting estimator with 175 features.
Fitting estimator with 174 features.
Fitting estimator with 173 features.
Fitting estimator with 172 features.
Fitting estimator with 171 features.
Fitting estimator with 170 features.
Fitting estimator with 169 features.
Fitting estimator with 168 features.
Fitting estimator with 167 features.
Fitting estimator with 166 features.
Fitting estimator with 165 features.
Fitting estimator with 164 features.
Fitting estimator with 163 features.
Fitting estimator with 162 features.
Fitting estimator with 161 features.
Fitting estimator with 160 features.
Fitting estimator with 159 features.
Fitting estimator with 158 features.
Fitting estimator with 157 features.
Fitting estimator with 156 features.
Fitting estimator with 155 features.
Fitting estimator with 154 features.
Fitting estimator with 153 features.
Fitting estimator with 152 features.
Fitting estimator with 151 features.
Fitting estimator with 150 features.
Fitting estimator with 149 features.
Fitting estimator with 148 features.
Fitting estimator with 147 features.
Fitting estimator with 146 features.
Fitting estimator with 145 features.
Fitting estimator with 144 features.
Fitting estimator with 143 features.
Fitting estimator with 142 features.
Fitting estimator with 141 features.
Fitting estimator with 140 features.
Fitting estimator with 139 features.
Fitting estimator with 138 features.
Fitting estimator with 137 features.
Fitting estimator with 136 features.
Fitting estimator with 135 features.
Fitting estimator with 134 features.
Fitting estimator with 133 features.
Fitting estimator with 132 features.
Fitting estimator with 131 features.
Fitting estimator with 130 features.
Fitting estimator with 129 features.
Fitting estimator with 128 features.
Fitting estimator with 127 features.
Fitting estimator with 126 features.
Fitting estimator with 125 features.
Fitting estimator with 124 features.
Fitting estimator with 123 features.
Fitting estimator with 122 features.
Fitting estimator with 121 features.
Fitting estimator with 120 features.
Fitting estimator with 119 features.
Fitting estimator with 118 features.
Fitting estimator with 117 features.
Fitting estimator with 116 features.
Fitting estimator with 115 features.
Fitting estimator with 114 features.
Fitting estimator with 113 features.
Fitting estimator with 112 features.
Fitting estimator with 111 features.
Fitting estimator with 110 features.
Fitting estimator with 109 features.
Fitting estimator with 108 features.
Fitting estimator with 107 features.
Fitting estimator with 106 features.
Fitting estimator with 105 features.
Fitting estimator with 104 features.
Fitting estimator with 103 features.
Fitting estimator with 102 features.
Fitting estimator with 101 features.
Fitting estimator with 100 features.
Fitting estimator with 99 features.
Fitting estimator with 98 features.
Fitting estimator with 97 features.
Fitting estimator with 96 features.
Fitting estimator with 95 features.
Fitting estimator with 94 features.
Fitting estimator with 93 features.
Fitting estimator with 92 features.
Fitting estimator with 91 features.
Fitting estimator with 90 features.
Fitting estimator with 89 features.
Fitting estimator with 88 features.
Fitting estimator with 87 features.
Fitting estimator with 86 features.
Fitting estimator with 85 features.
Fitting estimator with 84 features.
Fitting estimator with 83 features.
Fitting estimator with 82 features.
Fitting estimator with 81 features.
Fitting estimator with 80 features.
Fitting estimator with 79 features.
Fitting estimator with 78 features.
Fitting estimator with 77 features.
Fitting estimator with 76 features.
Fitting estimator with 75 features.
Fitting estimator with 74 features.
Fitting estimator with 73 features.
Fitting estimator with 72 features.
Fitting estimator with 71 features.
Fitting estimator with 70 features.
Fitting estimator with 69 features.
Fitting estimator with 68 features.
Fitting estimator with 67 features.
Fitting estimator with 66 features.
Fitting estimator with 65 features.
Fitting estimator with 64 features.
Fitting estimator with 63 features.
Fitting estimator with 62 features.
Fitting estimator with 61 features.
Fitting estimator with 60 features.
Fitting estimator with 59 features.
Fitting estimator with 58 features.
Fitting estimator with 57 features.
Fitting estimator with 56 features.
Fitting estimator with 55 features.
Fitting estimator with 54 features.
Fitting estimator with 53 features.
Fitting estimator with 52 features.
Fitting estimator with 51 features.
Fitting estimator with 50 features.
Fitting estimator with 49 features.
Fitting estimator with 48 features.
Fitting estimator with 47 features.
Fitting estimator with 46 features.
Fitting estimator with 45 features.
Fitting estimator with 44 features.
Fitting estimator with 43 features.
Fitting estimator with 42 features.
Fitting estimator with 41 features.
Fitting estimator with 40 features.
Fitting estimator with 39 features.
Fitting estimator with 38 features.
Fitting estimator with 37 features.
Fitting estimator with 36 features.
Fitting estimator with 35 features.
Fitting estimator with 34 features.
Fitting estimator with 33 features.
Fitting estimator with 32 features.
Fitting estimator with 31 features.
Fitting estimator with 30 features.
Fitting estimator with 29 features.
Fitting estimator with 28 features.
Fitting estimator with 27 features.
Fitting estimator with 26 features.
Fitting estimator with 25 features.
Fitting estimator with 24 features.
Fitting estimator with 23 features.
Fitting estimator with 22 features.
Fitting estimator with 21 features.
Fitting estimator with 20 features.
Fitting estimator with 19 features.
Fitting estimator with 18 features.
Fitting estimator with 17 features.
Fitting estimator with 16 features.
Fitting estimator with 15 features.
Fitting estimator with 14 features.
Fitting estimator with 13 features.
Fitting estimator with 12 features.
Fitting estimator with 11 features.
Fitting estimator with 10 features.
Fitting estimator with 9 features.
Fitting estimator with 8 features.
Fitting estimator with 7 features.
Fitting estimator with 6 features.
Fitting estimator with 5 features.
Fitting estimator with 4 features.
Fitting estimator with 3 features.
Fitting estimator with 2 features.
Fitting estimator with 880 features.
Fitting estimator with 879 features.
Fitting estimator with 878 features.
Fitting estimator with 877 features.
Fitting estimator with 876 features.
Fitting estimator with 875 features.
Fitting estimator with 874 features.
Fitting estimator with 873 features.
Fitting estimator with 872 features.
Fitting estimator with 871 features.
Fitting estimator with 870 features.
Fitting estimator with 869 features.
Fitting estimator with 868 features.
Fitting estimator with 867 features.
Fitting estimator with 866 features.
Fitting estimator with 865 features.
Fitting estimator with 864 features.
Fitting estimator with 863 features.
Fitting estimator with 862 features.
Fitting estimator with 861 features.
Fitting estimator with 860 features.
Fitting estimator with 859 features.
Fitting estimator with 858 features.
Fitting estimator with 857 features.
Fitting estimator with 856 features.
Fitting estimator with 855 features.
Fitting estimator with 854 features.
Fitting estimator with 853 features.
Fitting estimator with 852 features.
Fitting estimator with 851 features.
Fitting estimator with 850 features.
Fitting estimator with 849 features.
Fitting estimator with 848 features.
Fitting estimator with 847 features.
Fitting estimator with 846 features.
Fitting estimator with 845 features.
Fitting estimator with 844 features.
Fitting estimator with 843 features.
Fitting estimator with 842 features.
Fitting estimator with 841 features.
Fitting estimator with 840 features.
Fitting estimator with 839 features.
Fitting estimator with 838 features.
Fitting estimator with 837 features.
Fitting estimator with 836 features.
Fitting estimator with 835 features.
Fitting estimator with 834 features.
Fitting estimator with 833 features.
Fitting estimator with 832 features.
Fitting estimator with 831 features.
Fitting estimator with 830 features.
Fitting estimator with 829 features.
Fitting estimator with 828 features.
Fitting estimator with 827 features.
Fitting estimator with 826 features.
Fitting estimator with 825 features.
Fitting estimator with 824 features.
Fitting estimator with 823 features.
Fitting estimator with 822 features.
Fitting estimator with 821 features.
Fitting estimator with 820 features.
Fitting estimator with 819 features.
Fitting estimator with 818 features.
Fitting estimator with 817 features.
Fitting estimator with 816 features.
Fitting estimator with 815 features.
Fitting estimator with 814 features.
Fitting estimator with 813 features.
Fitting estimator with 812 features.
Fitting estimator with 811 features.
Fitting estimator with 810 features.
Fitting estimator with 809 features.
Fitting estimator with 808 features.
Fitting estimator with 807 features.
Fitting estimator with 806 features.
Fitting estimator with 805 features.
Fitting estimator with 804 features.
Fitting estimator with 803 features.
Fitting estimator with 802 features.
Fitting estimator with 801 features.
Fitting estimator with 800 features.
Fitting estimator with 799 features.
Fitting estimator with 798 features.
Fitting estimator with 797 features.
Fitting estimator with 796 features.
Fitting estimator with 795 features.
Fitting estimator with 794 features.
Fitting estimator with 793 features.
Fitting estimator with 792 features.
Fitting estimator with 791 features.
Fitting estimator with 790 features.
Fitting estimator with 789 features.
Fitting estimator with 788 features.
Fitting estimator with 787 features.
Fitting estimator with 786 features.
Fitting estimator with 785 features.
Fitting estimator with 784 features.
Fitting estimator with 783 features.
Fitting estimator with 782 features.
Fitting estimator with 781 features.
Fitting estimator with 780 features.
Fitting estimator with 779 features.
Fitting estimator with 778 features.
Fitting estimator with 777 features.
Fitting estimator with 776 features.
Fitting estimator with 775 features.
Fitting estimator with 774 features.
Fitting estimator with 773 features.
Fitting estimator with 772 features.
Fitting estimator with 771 features.
Fitting estimator with 770 features.
Fitting estimator with 769 features.
Fitting estimator with 768 features.
Fitting estimator with 767 features.
Fitting estimator with 766 features.
Fitting estimator with 765 features.
Fitting estimator with 764 features.
Fitting estimator with 763 features.
Fitting estimator with 762 features.
Fitting estimator with 761 features.
Fitting estimator with 760 features.
Fitting estimator with 759 features.
Fitting estimator with 758 features.
Fitting estimator with 757 features.
Fitting estimator with 756 features.
Fitting estimator with 755 features.
Fitting estimator with 754 features.
Fitting estimator with 753 features.
Fitting estimator with 752 features.
Fitting estimator with 751 features.
Fitting estimator with 750 features.
Fitting estimator with 749 features.
Fitting estimator with 748 features.
Fitting estimator with 747 features.
Fitting estimator with 746 features.
Fitting estimator with 745 features.
Fitting estimator with 744 features.
Fitting estimator with 743 features.
Fitting estimator with 742 features.
Fitting estimator with 741 features.
Fitting estimator with 740 features.
Fitting estimator with 739 features.
Fitting estimator with 738 features.
Fitting estimator with 737 features.
Fitting estimator with 736 features.
Fitting estimator with 735 features.
Fitting estimator with 734 features.
Fitting estimator with 733 features.
Fitting estimator with 732 features.
Fitting estimator with 731 features.
Fitting estimator with 730 features.
Fitting estimator with 729 features.
Fitting estimator with 728 features.
Fitting estimator with 727 features.
Fitting estimator with 726 features.
Fitting estimator with 725 features.
Fitting estimator with 724 features.
Fitting estimator with 723 features.
Fitting estimator with 722 features.
Fitting estimator with 721 features.
Fitting estimator with 720 features.
Fitting estimator with 719 features.
Fitting estimator with 718 features.
Fitting estimator with 717 features.
Fitting estimator with 716 features.
Fitting estimator with 715 features.
Fitting estimator with 714 features.
Fitting estimator with 713 features.
Fitting estimator with 712 features.
Fitting estimator with 711 features.
Fitting estimator with 710 features.
Fitting estimator with 709 features.
Fitting estimator with 708 features.
Fitting estimator with 707 features.
Fitting estimator with 706 features.
Fitting estimator with 705 features.
Fitting estimator with 704 features.
Fitting estimator with 703 features.
Fitting estimator with 702 features.
Fitting estimator with 701 features.
Fitting estimator with 700 features.
Fitting estimator with 699 features.
Fitting estimator with 698 features.
Fitting estimator with 697 features.
Fitting estimator with 696 features.
Fitting estimator with 695 features.
Fitting estimator with 694 features.
Fitting estimator with 693 features.
Fitting estimator with 692 features.
Fitting estimator with 691 features.
Fitting estimator with 690 features.
Fitting estimator with 689 features.
Fitting estimator with 688 features.
Fitting estimator with 687 features.
Fitting estimator with 686 features.
Fitting estimator with 685 features.
Fitting estimator with 684 features.
Fitting estimator with 683 features.
Fitting estimator with 682 features.
Fitting estimator with 681 features.
Fitting estimator with 680 features.
Fitting estimator with 679 features.
Fitting estimator with 678 features.
Fitting estimator with 677 features.
Fitting estimator with 676 features.
Fitting estimator with 675 features.
Fitting estimator with 674 features.
Fitting estimator with 673 features.
Fitting estimator with 672 features.
Fitting estimator with 671 features.
Fitting estimator with 670 features.
Fitting estimator with 669 features.
Fitting estimator with 668 features.
Fitting estimator with 667 features.
Fitting estimator with 666 features.
Fitting estimator with 665 features.
Fitting estimator with 664 features.
Fitting estimator with 663 features.
Fitting estimator with 662 features.
Fitting estimator with 661 features.
Fitting estimator with 660 features.
Fitting estimator with 659 features.
Fitting estimator with 658 features.
Fitting estimator with 657 features.
Fitting estimator with 656 features.
Fitting estimator with 655 features.
Fitting estimator with 654 features.
Fitting estimator with 653 features.
Fitting estimator with 652 features.
Fitting estimator with 651 features.
Fitting estimator with 650 features.
Fitting estimator with 649 features.
Fitting estimator with 648 features.
Fitting estimator with 647 features.
Fitting estimator with 646 features.
Fitting estimator with 645 features.
Fitting estimator with 644 features.
Fitting estimator with 643 features.
Fitting estimator with 642 features.
Fitting estimator with 641 features.
Fitting estimator with 640 features.
Fitting estimator with 639 features.
Fitting estimator with 638 features.
Fitting estimator with 637 features.
Fitting estimator with 636 features.
Fitting estimator with 635 features.
Fitting estimator with 634 features.
Fitting estimator with 633 features.
Fitting estimator with 632 features.
Fitting estimator with 631 features.
Fitting estimator with 630 features.
Fitting estimator with 629 features.
Fitting estimator with 628 features.
Fitting estimator with 627 features.
Fitting estimator with 626 features.
Fitting estimator with 625 features.
Fitting estimator with 624 features.
Fitting estimator with 623 features.
Fitting estimator with 622 features.
Fitting estimator with 621 features.
Fitting estimator with 620 features.
Fitting estimator with 619 features.
Fitting estimator with 618 features.
Fitting estimator with 617 features.
Fitting estimator with 616 features.
Fitting estimator with 615 features.
Fitting estimator with 614 features.
Fitting estimator with 613 features.
Fitting estimator with 612 features.
Fitting estimator with 611 features.
Fitting estimator with 610 features.
Fitting estimator with 609 features.
Fitting estimator with 608 features.
Fitting estimator with 607 features.
Fitting estimator with 606 features.
Fitting estimator with 605 features.
Fitting estimator with 604 features.
Fitting estimator with 603 features.
Fitting estimator with 602 features.
Fitting estimator with 601 features.
Fitting estimator with 600 features.
Fitting estimator with 599 features.
Fitting estimator with 598 features.
Fitting estimator with 597 features.
Fitting estimator with 596 features.
Fitting estimator with 595 features.
Fitting estimator with 594 features.
Fitting estimator with 593 features.
Fitting estimator with 592 features.
Fitting estimator with 591 features.
Fitting estimator with 590 features.
Fitting estimator with 589 features.
Fitting estimator with 588 features.
Fitting estimator with 587 features.
Fitting estimator with 586 features.
Fitting estimator with 585 features.
Fitting estimator with 584 features.
Fitting estimator with 583 features.
Fitting estimator with 582 features.
Fitting estimator with 581 features.
Fitting estimator with 580 features.
Fitting estimator with 579 features.
Fitting estimator with 578 features.
Fitting estimator with 577 features.
Fitting estimator with 576 features.
Fitting estimator with 575 features.
Fitting estimator with 574 features.
Fitting estimator with 573 features.
Fitting estimator with 572 features.
Fitting estimator with 571 features.
Fitting estimator with 570 features.
Fitting estimator with 569 features.
Fitting estimator with 568 features.
Fitting estimator with 567 features.
Fitting estimator with 566 features.
Fitting estimator with 565 features.
Fitting estimator with 564 features.
Fitting estimator with 563 features.
Fitting estimator with 562 features.
Fitting estimator with 561 features.
Fitting estimator with 560 features.
Fitting estimator with 559 features.
Fitting estimator with 558 features.
Fitting estimator with 557 features.
Fitting estimator with 556 features.
Fitting estimator with 555 features.
Fitting estimator with 554 features.
Fitting estimator with 553 features.
Fitting estimator with 552 features.
Fitting estimator with 551 features.
Fitting estimator with 550 features.
Fitting estimator with 549 features.
Fitting estimator with 548 features.
Fitting estimator with 547 features.
Fitting estimator with 546 features.
Fitting estimator with 545 features.
Fitting estimator with 544 features.
Fitting estimator with 543 features.
Fitting estimator with 542 features.
Fitting estimator with 541 features.
Fitting estimator with 540 features.
Fitting estimator with 539 features.
Fitting estimator with 538 features.
Fitting estimator with 537 features.
Fitting estimator with 536 features.
Fitting estimator with 535 features.
Fitting estimator with 534 features.
Fitting estimator with 533 features.
Fitting estimator with 532 features.
Fitting estimator with 531 features.
Fitting estimator with 530 features.
Fitting estimator with 529 features.
Fitting estimator with 528 features.
Fitting estimator with 527 features.
Fitting estimator with 526 features.
Fitting estimator with 525 features.
Fitting estimator with 524 features.
Fitting estimator with 523 features.
Fitting estimator with 522 features.
Fitting estimator with 521 features.
Fitting estimator with 520 features.
Fitting estimator with 519 features.
Fitting estimator with 518 features.
Fitting estimator with 517 features.
Fitting estimator with 516 features.
Fitting estimator with 515 features.
Fitting estimator with 514 features.
Fitting estimator with 513 features.
Fitting estimator with 512 features.
Fitting estimator with 511 features.
Fitting estimator with 510 features.
Fitting estimator with 509 features.
Fitting estimator with 508 features.
Fitting estimator with 507 features.
Fitting estimator with 506 features.
Fitting estimator with 505 features.
Fitting estimator with 504 features.
Fitting estimator with 503 features.
Fitting estimator with 502 features.
Fitting estimator with 501 features.
Fitting estimator with 500 features.
Fitting estimator with 499 features.
Fitting estimator with 498 features.
Fitting estimator with 497 features.
Fitting estimator with 496 features.
Fitting estimator with 495 features.
Fitting estimator with 494 features.
Fitting estimator with 493 features.
Fitting estimator with 492 features.
Fitting estimator with 491 features.
Fitting estimator with 490 features.
Fitting estimator with 489 features.
Fitting estimator with 488 features.
Fitting estimator with 487 features.
Fitting estimator with 486 features.
Fitting estimator with 485 features.
Fitting estimator with 484 features.
Fitting estimator with 483 features.
Fitting estimator with 482 features.
Fitting estimator with 481 features.
Fitting estimator with 480 features.
Fitting estimator with 479 features.
Fitting estimator with 478 features.
Fitting estimator with 477 features.
Fitting estimator with 476 features.
Fitting estimator with 475 features.
Fitting estimator with 474 features.
Fitting estimator with 473 features.
Fitting estimator with 472 features.
Fitting estimator with 471 features.
Fitting estimator with 470 features.
Fitting estimator with 469 features.
Fitting estimator with 468 features.
Fitting estimator with 467 features.
Fitting estimator with 466 features.
Fitting estimator with 465 features.
Fitting estimator with 464 features.
Fitting estimator with 463 features.
Fitting estimator with 462 features.
Fitting estimator with 461 features.
Fitting estimator with 460 features.
Fitting estimator with 459 features.
Fitting estimator with 458 features.
Fitting estimator with 457 features.
Fitting estimator with 456 features.
Fitting estimator with 455 features.
Fitting estimator with 454 features.
Fitting estimator with 453 features.
Fitting estimator with 452 features.
Fitting estimator with 451 features.
Fitting estimator with 450 features.
Fitting estimator with 449 features.
Fitting estimator with 448 features.
Fitting estimator with 447 features.
Fitting estimator with 446 features.
Fitting estimator with 445 features.
Fitting estimator with 444 features.
Fitting estimator with 443 features.
Fitting estimator with 442 features.
Fitting estimator with 441 features.
Fitting estimator with 440 features.
Fitting estimator with 439 features.
Fitting estimator with 438 features.
Fitting estimator with 437 features.
Fitting estimator with 436 features.
Fitting estimator with 435 features.
Fitting estimator with 434 features.
Fitting estimator with 433 features.
Fitting estimator with 432 features.
Fitting estimator with 431 features.
Fitting estimator with 430 features.
Fitting estimator with 429 features.
Fitting estimator with 428 features.
Fitting estimator with 427 features.
Fitting estimator with 426 features.
Fitting estimator with 425 features.
Fitting estimator with 424 features.
Fitting estimator with 423 features.
Fitting estimator with 422 features.
Fitting estimator with 421 features.
Fitting estimator with 420 features.
Fitting estimator with 419 features.
Fitting estimator with 418 features.
Fitting estimator with 417 features.
Fitting estimator with 416 features.
Fitting estimator with 415 features.
Fitting estimator with 414 features.
Fitting estimator with 413 features.
Fitting estimator with 412 features.
Fitting estimator with 411 features.
Fitting estimator with 410 features.
Fitting estimator with 409 features.
Fitting estimator with 408 features.
Fitting estimator with 407 features.
Fitting estimator with 406 features.
Fitting estimator with 405 features.
Fitting estimator with 404 features.
Fitting estimator with 403 features.
Fitting estimator with 402 features.
Fitting estimator with 401 features.
Fitting estimator with 400 features.
Fitting estimator with 399 features.
Fitting estimator with 398 features.
Fitting estimator with 397 features.
Fitting estimator with 396 features.
Fitting estimator with 395 features.
Fitting estimator with 394 features.
Fitting estimator with 393 features.
Fitting estimator with 392 features.
Fitting estimator with 391 features.
Fitting estimator with 390 features.
Fitting estimator with 389 features.
Fitting estimator with 388 features.
Fitting estimator with 387 features.
Fitting estimator with 386 features.
Fitting estimator with 385 features.
Fitting estimator with 384 features.
Fitting estimator with 383 features.
Fitting estimator with 382 features.
Fitting estimator with 381 features.
Fitting estimator with 380 features.
Fitting estimator with 379 features.
Fitting estimator with 378 features.
Fitting estimator with 377 features.
Fitting estimator with 376 features.
Fitting estimator with 375 features.
Fitting estimator with 374 features.
Fitting estimator with 373 features.
Fitting estimator with 372 features.
Fitting estimator with 371 features.
Fitting estimator with 370 features.
Fitting estimator with 369 features.
Fitting estimator with 368 features.
Fitting estimator with 367 features.
Fitting estimator with 366 features.
Fitting estimator with 365 features.
Fitting estimator with 364 features.
Fitting estimator with 363 features.
Fitting estimator with 362 features.
Fitting estimator with 361 features.
Fitting estimator with 360 features.
Fitting estimator with 359 features.
Fitting estimator with 358 features.
Fitting estimator with 357 features.
Fitting estimator with 356 features.
Fitting estimator with 355 features.
Fitting estimator with 354 features.
Fitting estimator with 353 features.
Fitting estimator with 352 features.
Fitting estimator with 351 features.
Fitting estimator with 350 features.
Fitting estimator with 349 features.
Fitting estimator with 348 features.
Fitting estimator with 347 features.
Fitting estimator with 346 features.
Fitting estimator with 345 features.
Fitting estimator with 344 features.
Fitting estimator with 343 features.
Fitting estimator with 342 features.
Fitting estimator with 341 features.
Fitting estimator with 340 features.
Fitting estimator with 339 features.
Fitting estimator with 338 features.
Fitting estimator with 337 features.
Fitting estimator with 336 features.
Fitting estimator with 335 features.
Fitting estimator with 334 features.
Fitting estimator with 333 features.
Fitting estimator with 332 features.
Fitting estimator with 331 features.
Fitting estimator with 330 features.
Fitting estimator with 329 features.
Fitting estimator with 328 features.
Fitting estimator with 327 features.
Fitting estimator with 326 features.
Fitting estimator with 325 features.
Fitting estimator with 324 features.
Fitting estimator with 323 features.
Fitting estimator with 322 features.
Fitting estimator with 321 features.
Fitting estimator with 320 features.
Fitting estimator with 319 features.
Fitting estimator with 318 features.
Fitting estimator with 317 features.
Fitting estimator with 316 features.
Fitting estimator with 315 features.
Fitting estimator with 314 features.
Fitting estimator with 313 features.
Fitting estimator with 312 features.
Fitting estimator with 311 features.
Fitting estimator with 310 features.
Fitting estimator with 309 features.
Fitting estimator with 308 features.
Fitting estimator with 307 features.
Fitting estimator with 306 features.
Fitting estimator with 305 features.
Fitting estimator with 304 features.
Fitting estimator with 303 features.
Fitting estimator with 302 features.
Fitting estimator with 301 features.
Fitting estimator with 300 features.
Fitting estimator with 299 features.
Fitting estimator with 298 features.
Fitting estimator with 297 features.
Fitting estimator with 296 features.
Fitting estimator with 295 features.
Fitting estimator with 294 features.
Fitting estimator with 293 features.
Fitting estimator with 292 features.
Fitting estimator with 291 features.
Fitting estimator with 290 features.
Fitting estimator with 289 features.
Fitting estimator with 288 features.
Fitting estimator with 287 features.
Fitting estimator with 286 features.
Fitting estimator with 285 features.
Fitting estimator with 284 features.
Fitting estimator with 283 features.
Fitting estimator with 282 features.
Fitting estimator with 281 features.
Fitting estimator with 280 features.
Fitting estimator with 279 features.
Fitting estimator with 278 features.
Fitting estimator with 277 features.
Fitting estimator with 276 features.
Fitting estimator with 275 features.
Fitting estimator with 274 features.
Fitting estimator with 273 features.
Fitting estimator with 272 features.
Fitting estimator with 271 features.
Fitting estimator with 270 features.
Fitting estimator with 269 features.
Fitting estimator with 268 features.
Fitting estimator with 267 features.
Fitting estimator with 266 features.
Fitting estimator with 265 features.
Fitting estimator with 264 features.
Fitting estimator with 263 features.
Fitting estimator with 262 features.
Fitting estimator with 261 features.
Fitting estimator with 260 features.
Fitting estimator with 259 features.
Fitting estimator with 258 features.
Fitting estimator with 257 features.
Fitting estimator with 256 features.
Fitting estimator with 255 features.
Fitting estimator with 254 features.
Fitting estimator with 253 features.
Fitting estimator with 252 features.
Fitting estimator with 251 features.
Fitting estimator with 250 features.
Fitting estimator with 249 features.
Fitting estimator with 248 features.
Fitting estimator with 247 features.
Fitting estimator with 246 features.
Fitting estimator with 245 features.
Fitting estimator with 244 features.
Fitting estimator with 243 features.
Fitting estimator with 242 features.
Fitting estimator with 241 features.
Fitting estimator with 240 features.
Fitting estimator with 239 features.
Fitting estimator with 238 features.
Fitting estimator with 237 features.
Fitting estimator with 236 features.
Fitting estimator with 235 features.
Fitting estimator with 234 features.
Fitting estimator with 233 features.
Fitting estimator with 232 features.
Fitting estimator with 231 features.
Fitting estimator with 230 features.
Fitting estimator with 229 features.
Fitting estimator with 228 features.
Fitting estimator with 227 features.
Fitting estimator with 226 features.
Fitting estimator with 225 features.
Fitting estimator with 224 features.
Fitting estimator with 223 features.
Fitting estimator with 222 features.
Fitting estimator with 221 features.
Fitting estimator with 220 features.
Fitting estimator with 219 features.
Fitting estimator with 218 features.
Fitting estimator with 217 features.
Fitting estimator with 216 features.
Fitting estimator with 215 features.
Fitting estimator with 214 features.
Fitting estimator with 213 features.
Fitting estimator with 212 features.
Fitting estimator with 211 features.
Fitting estimator with 210 features.
Fitting estimator with 209 features.
Fitting estimator with 208 features.
Fitting estimator with 207 features.
Fitting estimator with 206 features.
Fitting estimator with 205 features.
Fitting estimator with 204 features.
Fitting estimator with 203 features.
Fitting estimator with 202 features.
Fitting estimator with 201 features.
Fitting estimator with 200 features.
Fitting estimator with 199 features.
Fitting estimator with 198 features.
Fitting estimator with 197 features.
Fitting estimator with 196 features.
Fitting estimator with 195 features.
Fitting estimator with 194 features.
Fitting estimator with 193 features.
Fitting estimator with 192 features.
Fitting estimator with 191 features.
Fitting estimator with 190 features.
Fitting estimator with 189 features.
Fitting estimator with 188 features.
Fitting estimator with 187 features.
Fitting estimator with 186 features.
Fitting estimator with 185 features.
Fitting estimator with 184 features.
Fitting estimator with 183 features.
Fitting estimator with 182 features.
Fitting estimator with 181 features.
Fitting estimator with 180 features.
Fitting estimator with 179 features.
Fitting estimator with 178 features.
Fitting estimator with 177 features.
Fitting estimator with 176 features.
Fitting estimator with 175 features.
Fitting estimator with 174 features.
Fitting estimator with 173 features.
Fitting estimator with 172 features.
Fitting estimator with 171 features.
Fitting estimator with 170 features.
Fitting estimator with 169 features.
Fitting estimator with 168 features.
Fitting estimator with 167 features.
Fitting estimator with 166 features.
Fitting estimator with 165 features.
Fitting estimator with 164 features.
Fitting estimator with 163 features.
Fitting estimator with 162 features.
Fitting estimator with 161 features.
Fitting estimator with 160 features.
Fitting estimator with 159 features.
Fitting estimator with 158 features.
Fitting estimator with 157 features.
Fitting estimator with 156 features.
Fitting estimator with 155 features.
Fitting estimator with 154 features.
Fitting estimator with 153 features.
Fitting estimator with 152 features.
Fitting estimator with 151 features.
Fitting estimator with 150 features.
Fitting estimator with 149 features.
Fitting estimator with 148 features.
Fitting estimator with 147 features.
Fitting estimator with 146 features.
Fitting estimator with 145 features.
Fitting estimator with 144 features.
Fitting estimator with 143 features.
Fitting estimator with 142 features.
Fitting estimator with 141 features.
Fitting estimator with 140 features.
Fitting estimator with 139 features.
Fitting estimator with 138 features.
Fitting estimator with 137 features.
Fitting estimator with 136 features.
Fitting estimator with 135 features.
Fitting estimator with 134 features.
Fitting estimator with 133 features.
Fitting estimator with 132 features.
Fitting estimator with 131 features.
Fitting estimator with 130 features.
Fitting estimator with 129 features.
Fitting estimator with 128 features.
Fitting estimator with 127 features.
Fitting estimator with 126 features.
Fitting estimator with 125 features.
Fitting estimator with 124 features.
Fitting estimator with 123 features.
Fitting estimator with 122 features.
Fitting estimator with 121 features.
Fitting estimator with 120 features.
Fitting estimator with 119 features.
Fitting estimator with 118 features.
Fitting estimator with 117 features.
Fitting estimator with 116 features.
Fitting estimator with 115 features.
Fitting estimator with 114 features.
Fitting estimator with 113 features.
Fitting estimator with 112 features.
Fitting estimator with 111 features.
Fitting estimator with 110 features.
Fitting estimator with 109 features.
Fitting estimator with 108 features.
Fitting estimator with 107 features.
Fitting estimator with 106 features.
Fitting estimator with 105 features.
Fitting estimator with 104 features.
Fitting estimator with 103 features.
Fitting estimator with 102 features.
Fitting estimator with 101 features.
Fitting estimator with 100 features.
Fitting estimator with 99 features.
Fitting estimator with 98 features.
Fitting estimator with 97 features.
Fitting estimator with 96 features.
Fitting estimator with 95 features.
Fitting estimator with 94 features.
Fitting estimator with 93 features.
Fitting estimator with 92 features.
Fitting estimator with 91 features.
Fitting estimator with 90 features.
Fitting estimator with 89 features.
Fitting estimator with 88 features.
Fitting estimator with 87 features.
Fitting estimator with 86 features.
Fitting estimator with 85 features.
Fitting estimator with 84 features.
Fitting estimator with 83 features.
Fitting estimator with 82 features.
Fitting estimator with 81 features.
Fitting estimator with 80 features.
Fitting estimator with 79 features.
Fitting estimator with 78 features.
Fitting estimator with 77 features.
Fitting estimator with 76 features.
Fitting estimator with 75 features.
Fitting estimator with 74 features.
Fitting estimator with 73 features.
Fitting estimator with 72 features.
Fitting estimator with 71 features.
Fitting estimator with 70 features.
Fitting estimator with 69 features.
Fitting estimator with 68 features.
Fitting estimator with 67 features.
Fitting estimator with 66 features.
Fitting estimator with 65 features.
Fitting estimator with 64 features.
Fitting estimator with 63 features.
Fitting estimator with 62 features.
Fitting estimator with 61 features.
Fitting estimator with 60 features.
Fitting estimator with 59 features.
Fitting estimator with 58 features.
Fitting estimator with 57 features.
Fitting estimator with 56 features.
Fitting estimator with 55 features.
Fitting estimator with 54 features.
Fitting estimator with 53 features.
Fitting estimator with 52 features.
Fitting estimator with 51 features.
Fitting estimator with 50 features.
Fitting estimator with 49 features.
Fitting estimator with 48 features.
Fitting estimator with 47 features.
Fitting estimator with 46 features.
Fitting estimator with 45 features.
Fitting estimator with 44 features.
Fitting estimator with 43 features.
Fitting estimator with 42 features.
Fitting estimator with 41 features.
Fitting estimator with 40 features.
Fitting estimator with 39 features.
Fitting estimator with 38 features.
Fitting estimator with 37 features.
Fitting estimator with 36 features.
Fitting estimator with 35 features.
Fitting estimator with 34 features.
Fitting estimator with 33 features.
Fitting estimator with 32 features.
Fitting estimator with 31 features.
Fitting estimator with 30 features.
Fitting estimator with 29 features.
Fitting estimator with 28 features.
Fitting estimator with 27 features.
Fitting estimator with 26 features.
Fitting estimator with 25 features.
Fitting estimator with 24 features.
Fitting estimator with 23 features.
Fitting estimator with 22 features.
Fitting estimator with 21 features.
Fitting estimator with 20 features.
Fitting estimator with 19 features.
Fitting estimator with 18 features.
Fitting estimator with 17 features.
Fitting estimator with 16 features.
Fitting estimator with 15 features.
Fitting estimator with 14 features.
Fitting estimator with 13 features.
Fitting estimator with 12 features.
Fitting estimator with 11 features.
Fitting estimator with 10 features.
Fitting estimator with 9 features.
Fitting estimator with 8 features.
Fitting estimator with 7 features.
Fitting estimator with 6 features.
Fitting estimator with 5 features.
Fitting estimator with 4 features.
Fitting estimator with 3 features.
Fitting estimator with 2 features.
Fitting estimator with 880 features.
Fitting estimator with 879 features.
Fitting estimator with 878 features.
Fitting estimator with 877 features.
Fitting estimator with 876 features.
Fitting estimator with 875 features.
Fitting estimator with 874 features.
Fitting estimator with 873 features.
Fitting estimator with 872 features.
Fitting estimator with 871 features.
Fitting estimator with 870 features.
Fitting estimator with 869 features.
Fitting estimator with 868 features.
Fitting estimator with 867 features.
Fitting estimator with 866 features.
Fitting estimator with 865 features.
Fitting estimator with 864 features.
Fitting estimator with 863 features.
Fitting estimator with 862 features.
Fitting estimator with 861 features.
Fitting estimator with 860 features.
Fitting estimator with 859 features.
Fitting estimator with 858 features.
Fitting estimator with 857 features.
Fitting estimator with 856 features.
Fitting estimator with 855 features.
Fitting estimator with 854 features.
Fitting estimator with 853 features.
Fitting estimator with 852 features.
Fitting estimator with 851 features.
Fitting estimator with 850 features.
Fitting estimator with 849 features.
Fitting estimator with 848 features.
Fitting estimator with 847 features.
Fitting estimator with 846 features.
Fitting estimator with 845 features.
Fitting estimator with 844 features.
Fitting estimator with 843 features.
Fitting estimator with 842 features.
Fitting estimator with 841 features.
Fitting estimator with 840 features.
Fitting estimator with 839 features.
Fitting estimator with 838 features.
Fitting estimator with 837 features.
Fitting estimator with 836 features.
Fitting estimator with 835 features.
Fitting estimator with 834 features.
Fitting estimator with 833 features.
Fitting estimator with 832 features.
Fitting estimator with 831 features.
Fitting estimator with 830 features.
Fitting estimator with 829 features.
Fitting estimator with 828 features.
Fitting estimator with 827 features.
Fitting estimator with 826 features.
Fitting estimator with 825 features.
Fitting estimator with 824 features.
Fitting estimator with 823 features.
Fitting estimator with 822 features.
Fitting estimator with 821 features.
Fitting estimator with 820 features.
Fitting estimator with 819 features.
Fitting estimator with 818 features.
Fitting estimator with 817 features.
Fitting estimator with 816 features.
Fitting estimator with 815 features.
Fitting estimator with 814 features.
Fitting estimator with 813 features.
Fitting estimator with 812 features.
Fitting estimator with 811 features.
Fitting estimator with 810 features.
Fitting estimator with 809 features.
Fitting estimator with 808 features.
Fitting estimator with 807 features.
Fitting estimator with 806 features.
Fitting estimator with 805 features.
Fitting estimator with 804 features.
Fitting estimator with 803 features.
Fitting estimator with 802 features.
Fitting estimator with 801 features.
Fitting estimator with 800 features.
Fitting estimator with 799 features.
Fitting estimator with 798 features.
Fitting estimator with 797 features.
Fitting estimator with 796 features.
Fitting estimator with 795 features.
Fitting estimator with 794 features.
Fitting estimator with 793 features.
Fitting estimator with 792 features.
Fitting estimator with 791 features.
Fitting estimator with 790 features.
Fitting estimator with 789 features.
Fitting estimator with 788 features.
Fitting estimator with 787 features.
Fitting estimator with 786 features.
Fitting estimator with 785 features.
Fitting estimator with 784 features.
Fitting estimator with 783 features.
Fitting estimator with 782 features.
Fitting estimator with 781 features.
Fitting estimator with 780 features.
Fitting estimator with 779 features.
Fitting estimator with 778 features.
Fitting estimator with 777 features.
Fitting estimator with 776 features.
Fitting estimator with 775 features.
Fitting estimator with 774 features.
Fitting estimator with 773 features.
Fitting estimator with 772 features.
Fitting estimator with 771 features.
Fitting estimator with 770 features.
Fitting estimator with 769 features.
Fitting estimator with 768 features.
Fitting estimator with 767 features.
Fitting estimator with 766 features.
Fitting estimator with 765 features.
Fitting estimator with 764 features.
Fitting estimator with 763 features.
Fitting estimator with 762 features.
Fitting estimator with 761 features.
Fitting estimator with 760 features.
Fitting estimator with 759 features.
Fitting estimator with 758 features.
Fitting estimator with 757 features.
Fitting estimator with 756 features.
Fitting estimator with 755 features.
Fitting estimator with 754 features.
Fitting estimator with 753 features.
Fitting estimator with 752 features.
Fitting estimator with 751 features.
Fitting estimator with 750 features.
Fitting estimator with 749 features.
Fitting estimator with 748 features.
Fitting estimator with 747 features.
Fitting estimator with 746 features.
Fitting estimator with 745 features.
Fitting estimator with 744 features.
Fitting estimator with 743 features.
Fitting estimator with 742 features.
Fitting estimator with 741 features.
Fitting estimator with 740 features.
Fitting estimator with 739 features.
Fitting estimator with 738 features.
Fitting estimator with 737 features.
Fitting estimator with 736 features.
Fitting estimator with 735 features.
Fitting estimator with 734 features.
Fitting estimator with 733 features.
Fitting estimator with 732 features.
Fitting estimator with 731 features.
Fitting estimator with 730 features.
Fitting estimator with 729 features.
Fitting estimator with 728 features.
Fitting estimator with 727 features.
Fitting estimator with 726 features.
Fitting estimator with 725 features.
Fitting estimator with 724 features.
Fitting estimator with 723 features.
Fitting estimator with 722 features.
Fitting estimator with 721 features.
Fitting estimator with 720 features.
Fitting estimator with 719 features.
Fitting estimator with 718 features.
Fitting estimator with 717 features.
Fitting estimator with 716 features.
Fitting estimator with 715 features.
Fitting estimator with 714 features.
Fitting estimator with 713 features.
Fitting estimator with 712 features.
Fitting estimator with 711 features.
Fitting estimator with 710 features.
Fitting estimator with 709 features.
Fitting estimator with 708 features.
Fitting estimator with 707 features.
Fitting estimator with 706 features.
Fitting estimator with 705 features.
Fitting estimator with 704 features.
Fitting estimator with 703 features.
Fitting estimator with 702 features.
Fitting estimator with 701 features.
Fitting estimator with 700 features.
Fitting estimator with 699 features.
Fitting estimator with 698 features.
Fitting estimator with 697 features.
Fitting estimator with 696 features.
Fitting estimator with 695 features.
Fitting estimator with 694 features.
Fitting estimator with 693 features.
Fitting estimator with 692 features.
Fitting estimator with 691 features.
Fitting estimator with 690 features.
Fitting estimator with 689 features.
Fitting estimator with 688 features.
Fitting estimator with 687 features.
Fitting estimator with 686 features.
Fitting estimator with 685 features.
Fitting estimator with 684 features.
Fitting estimator with 683 features.
Fitting estimator with 682 features.
Fitting estimator with 681 features.
Fitting estimator with 680 features.
Fitting estimator with 679 features.
Fitting estimator with 678 features.
Fitting estimator with 677 features.
Fitting estimator with 676 features.
Fitting estimator with 675 features.
Fitting estimator with 674 features.
Fitting estimator with 673 features.
Fitting estimator with 672 features.
Fitting estimator with 671 features.
Fitting estimator with 670 features.
Fitting estimator with 669 features.
Fitting estimator with 668 features.
Fitting estimator with 667 features.
Fitting estimator with 666 features.
Fitting estimator with 665 features.
Fitting estimator with 664 features.
Fitting estimator with 663 features.
Fitting estimator with 662 features.
Fitting estimator with 661 features.
Fitting estimator with 660 features.
Fitting estimator with 659 features.
Fitting estimator with 658 features.
Fitting estimator with 657 features.
Fitting estimator with 656 features.
Fitting estimator with 655 features.
Fitting estimator with 654 features.
Fitting estimator with 653 features.
Fitting estimator with 652 features.
Fitting estimator with 651 features.
Fitting estimator with 650 features.
Fitting estimator with 649 features.
Fitting estimator with 648 features.
Fitting estimator with 647 features.
Fitting estimator with 646 features.
Fitting estimator with 645 features.
Fitting estimator with 644 features.
Fitting estimator with 643 features.
Fitting estimator with 642 features.
Fitting estimator with 641 features.
Fitting estimator with 640 features.
Fitting estimator with 639 features.
Fitting estimator with 638 features.
Fitting estimator with 637 features.
Fitting estimator with 636 features.
Fitting estimator with 635 features.
Fitting estimator with 634 features.
Fitting estimator with 633 features.
Fitting estimator with 632 features.
Fitting estimator with 631 features.
Fitting estimator with 630 features.
Fitting estimator with 629 features.
Fitting estimator with 628 features.
Fitting estimator with 627 features.
Fitting estimator with 626 features.
Fitting estimator with 625 features.
Fitting estimator with 624 features.
Fitting estimator with 623 features.
Fitting estimator with 622 features.
Fitting estimator with 621 features.
Fitting estimator with 620 features.
Fitting estimator with 619 features.
Fitting estimator with 618 features.
Fitting estimator with 617 features.
Fitting estimator with 616 features.
Fitting estimator with 615 features.
Fitting estimator with 614 features.
Fitting estimator with 613 features.
Fitting estimator with 612 features.
Fitting estimator with 611 features.
Fitting estimator with 610 features.
Fitting estimator with 609 features.
Fitting estimator with 608 features.
Fitting estimator with 607 features.
Fitting estimator with 606 features.
Fitting estimator with 605 features.
Fitting estimator with 604 features.
Fitting estimator with 603 features.
Fitting estimator with 602 features.
Fitting estimator with 601 features.
Fitting estimator with 600 features.
Fitting estimator with 599 features.
Fitting estimator with 598 features.
Fitting estimator with 597 features.
Fitting estimator with 596 features.
Fitting estimator with 595 features.
Fitting estimator with 594 features.
Fitting estimator with 593 features.
Fitting estimator with 592 features.
Fitting estimator with 591 features.
Fitting estimator with 590 features.
Fitting estimator with 589 features.
Fitting estimator with 588 features.
Fitting estimator with 587 features.
Fitting estimator with 586 features.
Fitting estimator with 585 features.
Fitting estimator with 584 features.
Fitting estimator with 583 features.
Fitting estimator with 582 features.
Fitting estimator with 581 features.
Fitting estimator with 580 features.
Fitting estimator with 579 features.
Fitting estimator with 578 features.
Fitting estimator with 577 features.
Fitting estimator with 576 features.
Fitting estimator with 575 features.
Fitting estimator with 574 features.
Fitting estimator with 573 features.
Fitting estimator with 572 features.
Fitting estimator with 571 features.
Fitting estimator with 570 features.
Fitting estimator with 569 features.
Fitting estimator with 568 features.
Fitting estimator with 567 features.
Fitting estimator with 566 features.
Fitting estimator with 565 features.
Fitting estimator with 564 features.
Fitting estimator with 563 features.
Fitting estimator with 562 features.
Fitting estimator with 561 features.
Fitting estimator with 560 features.
Fitting estimator with 559 features.
Fitting estimator with 558 features.
Fitting estimator with 557 features.
Fitting estimator with 556 features.
Fitting estimator with 555 features.
Fitting estimator with 554 features.
Fitting estimator with 553 features.
Fitting estimator with 552 features.
Fitting estimator with 551 features.
Fitting estimator with 550 features.
Fitting estimator with 549 features.
Fitting estimator with 548 features.
Fitting estimator with 547 features.
Fitting estimator with 546 features.
Fitting estimator with 545 features.
Fitting estimator with 544 features.
Fitting estimator with 543 features.
Fitting estimator with 542 features.
Fitting estimator with 541 features.
Fitting estimator with 540 features.
Fitting estimator with 539 features.
Fitting estimator with 538 features.
Fitting estimator with 537 features.
Fitting estimator with 536 features.
Fitting estimator with 535 features.
Fitting estimator with 534 features.
Fitting estimator with 533 features.
Fitting estimator with 532 features.
Fitting estimator with 531 features.
Fitting estimator with 530 features.
Fitting estimator with 529 features.
Fitting estimator with 528 features.
Fitting estimator with 527 features.
Fitting estimator with 526 features.
Fitting estimator with 525 features.
Fitting estimator with 524 features.
Fitting estimator with 523 features.
Fitting estimator with 522 features.
Fitting estimator with 521 features.
Fitting estimator with 520 features.
Fitting estimator with 519 features.
Fitting estimator with 518 features.
Fitting estimator with 517 features.
Fitting estimator with 516 features.
Fitting estimator with 515 features.
Fitting estimator with 514 features.
Fitting estimator with 513 features.
Fitting estimator with 512 features.
Fitting estimator with 511 features.
Fitting estimator with 510 features.
Fitting estimator with 509 features.
Fitting estimator with 508 features.
Fitting estimator with 507 features.
Fitting estimator with 506 features.
Fitting estimator with 505 features.
Fitting estimator with 504 features.
Fitting estimator with 503 features.
Fitting estimator with 502 features.
Fitting estimator with 501 features.
Fitting estimator with 500 features.
Fitting estimator with 499 features.
Fitting estimator with 498 features.
Fitting estimator with 497 features.
Fitting estimator with 496 features.
Fitting estimator with 495 features.
Fitting estimator with 494 features.
Fitting estimator with 493 features.
Fitting estimator with 492 features.
Fitting estimator with 491 features.
Fitting estimator with 490 features.
Fitting estimator with 489 features.
Fitting estimator with 488 features.
Fitting estimator with 487 features.
Fitting estimator with 486 features.
Fitting estimator with 485 features.
Fitting estimator with 484 features.
Fitting estimator with 483 features.
Fitting estimator with 482 features.
Fitting estimator with 481 features.
Fitting estimator with 480 features.
Fitting estimator with 479 features.
Fitting estimator with 478 features.
Fitting estimator with 477 features.
Fitting estimator with 476 features.
Fitting estimator with 475 features.
Fitting estimator with 474 features.
Fitting estimator with 473 features.
Fitting estimator with 472 features.
Fitting estimator with 471 features.
Fitting estimator with 470 features.
Fitting estimator with 469 features.
Fitting estimator with 468 features.
Fitting estimator with 467 features.
Fitting estimator with 466 features.
Fitting estimator with 465 features.
Fitting estimator with 464 features.
Fitting estimator with 463 features.
Fitting estimator with 462 features.
Fitting estimator with 461 features.
Fitting estimator with 460 features.
Fitting estimator with 459 features.
Fitting estimator with 458 features.
Fitting estimator with 457 features.
Fitting estimator with 456 features.
Fitting estimator with 455 features.
Fitting estimator with 454 features.
Fitting estimator with 453 features.
Fitting estimator with 452 features.
Fitting estimator with 451 features.
Fitting estimator with 450 features.
Fitting estimator with 449 features.
Fitting estimator with 448 features.
Fitting estimator with 447 features.
Fitting estimator with 446 features.
Fitting estimator with 445 features.
Fitting estimator with 444 features.
Fitting estimator with 443 features.
Fitting estimator with 442 features.
Fitting estimator with 441 features.
Fitting estimator with 440 features.
Fitting estimator with 439 features.
Fitting estimator with 438 features.
Fitting estimator with 437 features.
Fitting estimator with 436 features.
Fitting estimator with 435 features.
Fitting estimator with 434 features.
Fitting estimator with 433 features.
Fitting estimator with 432 features.
Fitting estimator with 431 features.
Fitting estimator with 430 features.
Fitting estimator with 429 features.
Fitting estimator with 428 features.
Fitting estimator with 427 features.
Fitting estimator with 426 features.
Fitting estimator with 425 features.
Fitting estimator with 424 features.
Fitting estimator with 423 features.
Fitting estimator with 422 features.
Fitting estimator with 421 features.
Fitting estimator with 420 features.
Fitting estimator with 419 features.
Fitting estimator with 418 features.
Fitting estimator with 417 features.
Fitting estimator with 416 features.
Fitting estimator with 415 features.
Fitting estimator with 414 features.
Fitting estimator with 413 features.
Fitting estimator with 412 features.
Fitting estimator with 411 features.
Fitting estimator with 410 features.
Fitting estimator with 409 features.
Fitting estimator with 408 features.
Fitting estimator with 407 features.
Fitting estimator with 406 features.
Fitting estimator with 405 features.
Fitting estimator with 404 features.
Fitting estimator with 403 features.
Fitting estimator with 402 features.
Fitting estimator with 401 features.
Fitting estimator with 400 features.
Fitting estimator with 399 features.
Fitting estimator with 398 features.
Fitting estimator with 397 features.
Fitting estimator with 396 features.
Fitting estimator with 395 features.
Fitting estimator with 394 features.
Fitting estimator with 393 features.
Fitting estimator with 392 features.
Fitting estimator with 391 features.
Fitting estimator with 390 features.
Fitting estimator with 389 features.
Fitting estimator with 388 features.
Fitting estimator with 387 features.
Fitting estimator with 386 features.
Fitting estimator with 385 features.
Fitting estimator with 384 features.
Fitting estimator with 383 features.
Fitting estimator with 382 features.
Fitting estimator with 381 features.
Fitting estimator with 380 features.
Fitting estimator with 379 features.
Fitting estimator with 378 features.
Fitting estimator with 377 features.
Fitting estimator with 376 features.
Fitting estimator with 375 features.
Fitting estimator with 374 features.
Fitting estimator with 373 features.
Fitting estimator with 372 features.
Fitting estimator with 371 features.
Fitting estimator with 370 features.
Fitting estimator with 369 features.
Fitting estimator with 368 features.
Fitting estimator with 367 features.
Fitting estimator with 366 features.
Fitting estimator with 365 features.
Fitting estimator with 364 features.
Fitting estimator with 363 features.
Fitting estimator with 362 features.
Fitting estimator with 361 features.
Fitting estimator with 360 features.
Fitting estimator with 359 features.
Fitting estimator with 358 features.
Fitting estimator with 357 features.
Fitting estimator with 356 features.
Fitting estimator with 355 features.
Fitting estimator with 354 features.
Fitting estimator with 353 features.
Fitting estimator with 352 features.
Fitting estimator with 351 features.
Fitting estimator with 350 features.
Fitting estimator with 349 features.
Fitting estimator with 348 features.
Fitting estimator with 347 features.
Fitting estimator with 346 features.
Fitting estimator with 345 features.
Fitting estimator with 344 features.
Fitting estimator with 343 features.
Fitting estimator with 342 features.
Fitting estimator with 341 features.
Fitting estimator with 340 features.
Fitting estimator with 339 features.
Fitting estimator with 338 features.
Fitting estimator with 337 features.
Fitting estimator with 336 features.
Fitting estimator with 335 features.
Fitting estimator with 334 features.
Fitting estimator with 333 features.
Fitting estimator with 332 features.
Fitting estimator with 331 features.
Fitting estimator with 330 features.
Fitting estimator with 329 features.
Fitting estimator with 328 features.
Fitting estimator with 327 features.
Fitting estimator with 326 features.
Fitting estimator with 325 features.
Fitting estimator with 324 features.
Fitting estimator with 323 features.
Fitting estimator with 322 features.
Fitting estimator with 321 features.
Fitting estimator with 320 features.
Fitting estimator with 319 features.
Fitting estimator with 318 features.
Fitting estimator with 317 features.
Fitting estimator with 316 features.
Fitting estimator with 315 features.
Fitting estimator with 314 features.
Fitting estimator with 313 features.
Fitting estimator with 312 features.
Fitting estimator with 311 features.
Fitting estimator with 310 features.
Fitting estimator with 309 features.
Fitting estimator with 308 features.
Fitting estimator with 307 features.
Fitting estimator with 306 features.
Fitting estimator with 305 features.
Fitting estimator with 304 features.
Fitting estimator with 303 features.
Fitting estimator with 302 features.
Fitting estimator with 301 features.
Fitting estimator with 300 features.
Fitting estimator with 299 features.
Fitting estimator with 298 features.
Fitting estimator with 297 features.
Fitting estimator with 296 features.
Fitting estimator with 295 features.
Fitting estimator with 294 features.
Fitting estimator with 293 features.
Fitting estimator with 292 features.
Fitting estimator with 291 features.
Fitting estimator with 290 features.
Fitting estimator with 289 features.
Fitting estimator with 288 features.
Fitting estimator with 287 features.
Fitting estimator with 286 features.
Fitting estimator with 285 features.
Fitting estimator with 284 features.
Fitting estimator with 283 features.
Fitting estimator with 282 features.
Fitting estimator with 281 features.
Fitting estimator with 280 features.
Fitting estimator with 279 features.
Fitting estimator with 278 features.
Fitting estimator with 277 features.
Fitting estimator with 276 features.
Fitting estimator with 275 features.
Fitting estimator with 274 features.
Fitting estimator with 273 features.
Fitting estimator with 272 features.
Fitting estimator with 271 features.
Fitting estimator with 270 features.
Fitting estimator with 269 features.
Fitting estimator with 268 features.
Fitting estimator with 267 features.
Fitting estimator with 266 features.
Fitting estimator with 265 features.
Fitting estimator with 264 features.
Fitting estimator with 263 features.
Fitting estimator with 262 features.
Fitting estimator with 261 features.
Fitting estimator with 260 features.
Fitting estimator with 259 features.
Fitting estimator with 258 features.
Fitting estimator with 257 features.
Fitting estimator with 256 features.
Fitting estimator with 255 features.
Fitting estimator with 254 features.
Fitting estimator with 253 features.
Fitting estimator with 252 features.
Fitting estimator with 251 features.
Fitting estimator with 250 features.
Fitting estimator with 249 features.
Fitting estimator with 248 features.
Fitting estimator with 247 features.
Fitting estimator with 246 features.
Fitting estimator with 245 features.
Fitting estimator with 244 features.
Fitting estimator with 243 features.
Fitting estimator with 242 features.
Fitting estimator with 241 features.
Fitting estimator with 240 features.
Fitting estimator with 239 features.
Fitting estimator with 238 features.
Fitting estimator with 237 features.
Fitting estimator with 236 features.
Fitting estimator with 235 features.
Fitting estimator with 234 features.
Fitting estimator with 233 features.
Fitting estimator with 232 features.
Fitting estimator with 231 features.
Fitting estimator with 230 features.
Fitting estimator with 229 features.
Fitting estimator with 228 features.
Fitting estimator with 227 features.
Fitting estimator with 226 features.
Fitting estimator with 225 features.
Fitting estimator with 224 features.
Fitting estimator with 223 features.
Fitting estimator with 222 features.
Fitting estimator with 221 features.
Fitting estimator with 220 features.
Fitting estimator with 219 features.
Fitting estimator with 218 features.
Fitting estimator with 217 features.
Fitting estimator with 216 features.
Fitting estimator with 215 features.
Fitting estimator with 214 features.
Fitting estimator with 213 features.
Fitting estimator with 212 features.
Fitting estimator with 211 features.
Fitting estimator with 210 features.
Fitting estimator with 209 features.
Fitting estimator with 208 features.
Fitting estimator with 207 features.
Fitting estimator with 206 features.
Fitting estimator with 205 features.
Fitting estimator with 204 features.
Fitting estimator with 203 features.
Fitting estimator with 202 features.
Fitting estimator with 201 features.
Fitting estimator with 200 features.
Fitting estimator with 199 features.
Fitting estimator with 198 features.
Fitting estimator with 197 features.
Fitting estimator with 196 features.
Fitting estimator with 195 features.
Fitting estimator with 194 features.
Fitting estimator with 193 features.
Fitting estimator with 192 features.
Fitting estimator with 191 features.
Fitting estimator with 190 features.
Fitting estimator with 189 features.
Fitting estimator with 188 features.
Fitting estimator with 187 features.
Fitting estimator with 186 features.
Fitting estimator with 185 features.
Fitting estimator with 184 features.
Fitting estimator with 183 features.
Fitting estimator with 182 features.
Fitting estimator with 181 features.
Fitting estimator with 180 features.
Fitting estimator with 179 features.
Fitting estimator with 178 features.
Fitting estimator with 177 features.
Fitting estimator with 176 features.
Fitting estimator with 175 features.
Fitting estimator with 174 features.
Fitting estimator with 173 features.
Fitting estimator with 172 features.
Fitting estimator with 171 features.
Fitting estimator with 170 features.
Fitting estimator with 169 features.
Fitting estimator with 168 features.
Fitting estimator with 167 features.
Fitting estimator with 166 features.
Fitting estimator with 165 features.
Fitting estimator with 164 features.
Fitting estimator with 163 features.
Fitting estimator with 162 features.
Fitting estimator with 161 features.
Fitting estimator with 160 features.
Fitting estimator with 159 features.
Fitting estimator with 158 features.
Fitting estimator with 157 features.
Fitting estimator with 156 features.
Fitting estimator with 155 features.
Fitting estimator with 154 features.
Fitting estimator with 153 features.
Fitting estimator with 152 features.
Fitting estimator with 151 features.
Fitting estimator with 150 features.
Fitting estimator with 149 features.
Fitting estimator with 148 features.
Fitting estimator with 147 features.
Fitting estimator with 146 features.
Fitting estimator with 145 features.
Fitting estimator with 144 features.
Fitting estimator with 143 features.
Fitting estimator with 142 features.
Fitting estimator with 141 features.
Fitting estimator with 140 features.
Fitting estimator with 139 features.
Fitting estimator with 138 features.
Fitting estimator with 137 features.
Fitting estimator with 136 features.
Fitting estimator with 135 features.
Fitting estimator with 134 features.
Fitting estimator with 133 features.
Fitting estimator with 132 features.
Fitting estimator with 131 features.
Fitting estimator with 130 features.
Fitting estimator with 129 features.
Fitting estimator with 128 features.
Fitting estimator with 127 features.
Fitting estimator with 126 features.
Fitting estimator with 125 features.
Fitting estimator with 124 features.
Fitting estimator with 123 features.
Fitting estimator with 122 features.
Fitting estimator with 121 features.
Fitting estimator with 120 features.
Fitting estimator with 119 features.
Fitting estimator with 118 features.
Fitting estimator with 117 features.
Fitting estimator with 116 features.
Fitting estimator with 115 features.
Fitting estimator with 114 features.
Fitting estimator with 113 features.
Fitting estimator with 112 features.
Fitting estimator with 111 features.
Fitting estimator with 110 features.
Fitting estimator with 109 features.
Fitting estimator with 108 features.
Fitting estimator with 107 features.
Fitting estimator with 106 features.
Fitting estimator with 105 features.
Fitting estimator with 104 features.
Fitting estimator with 103 features.
Fitting estimator with 102 features.
Fitting estimator with 101 features.
Fitting estimator with 100 features.
Fitting estimator with 99 features.
Fitting estimator with 98 features.
Fitting estimator with 97 features.
Fitting estimator with 96 features.
Fitting estimator with 95 features.
Fitting estimator with 94 features.
Fitting estimator with 93 features.
Fitting estimator with 92 features.
Fitting estimator with 91 features.
Fitting estimator with 90 features.
Fitting estimator with 89 features.
Fitting estimator with 88 features.
Fitting estimator with 87 features.
Fitting estimator with 86 features.
Fitting estimator with 85 features.
Fitting estimator with 84 features.
Fitting estimator with 83 features.
Fitting estimator with 82 features.
Fitting estimator with 81 features.
Fitting estimator with 80 features.
Fitting estimator with 79 features.
Fitting estimator with 78 features.
Fitting estimator with 77 features.
Fitting estimator with 76 features.
Fitting estimator with 75 features.
Fitting estimator with 74 features.
Fitting estimator with 73 features.
Fitting estimator with 72 features.
Fitting estimator with 71 features.
Fitting estimator with 70 features.
Fitting estimator with 69 features.
Fitting estimator with 68 features.
Fitting estimator with 67 features.
Fitting estimator with 66 features.
Fitting estimator with 65 features.
Fitting estimator with 64 features.
Fitting estimator with 63 features.
Fitting estimator with 62 features.
Fitting estimator with 61 features.
Fitting estimator with 60 features.
Fitting estimator with 59 features.
Fitting estimator with 58 features.
Fitting estimator with 57 features.
Fitting estimator with 56 features.
Fitting estimator with 55 features.
Fitting estimator with 54 features.
Fitting estimator with 53 features.
Fitting estimator with 52 features.
Fitting estimator with 51 features.
Fitting estimator with 50 features.
Fitting estimator with 49 features.
Fitting estimator with 48 features.
Fitting estimator with 47 features.
Fitting estimator with 46 features.
Fitting estimator with 45 features.
Fitting estimator with 44 features.
Fitting estimator with 43 features.
Fitting estimator with 42 features.
Fitting estimator with 41 features.
Fitting estimator with 40 features.
Fitting estimator with 39 features.
Fitting estimator with 38 features.
Fitting estimator with 37 features.
Fitting estimator with 36 features.
Fitting estimator with 35 features.
Fitting estimator with 34 features.
Fitting estimator with 33 features.
Fitting estimator with 32 features.
Fitting estimator with 31 features.
Fitting estimator with 30 features.
Fitting estimator with 29 features.
Fitting estimator with 28 features.
Fitting estimator with 27 features.
Fitting estimator with 26 features.
Fitting estimator with 25 features.
Fitting estimator with 24 features.
Fitting estimator with 23 features.
Fitting estimator with 22 features.
Fitting estimator with 21 features.
Fitting estimator with 20 features.
Fitting estimator with 19 features.
Fitting estimator with 18 features.
Fitting estimator with 17 features.
Fitting estimator with 16 features.
Fitting estimator with 15 features.
Fitting estimator with 14 features.
Fitting estimator with 13 features.
Fitting estimator with 12 features.
Fitting estimator with 11 features.
Fitting estimator with 10 features.
Fitting estimator with 9 features.
Fitting estimator with 8 features.
Fitting estimator with 7 features.
Fitting estimator with 6 features.
# Save the model
joblib.dump(selector_lin_reg_cv, "selector_lin_reg_cv.joblib")
['selector_lin_reg_cv.joblib']

As shown in the graph below, as the number of feature decreases, the validation loss tend to decrease.

def plot_n_feature_val_loss(selector, step, model_name="", mark=None):
    """
    Plot the validation loss (MSE) versus the number of features used.

    Parameters:
        selector: The RFECV selector containing cv_results_.
        step (int): The step size used in feature elimination.
        model_name (str): Name of the model for title annotation.
        mark: Marker style for the plot.
    """
    # Extract results.
    n_features = np.array(range(1, len(selector.cv_results_["mean_test_score"]) + 1))
    validation_loss = -selector.cv_results_["mean_test_score"]  # Convert to positive MSE.

    # Plot.
    plt.figure(figsize=(12, 6))
    plt.plot(n_features * step, validation_loss, marker=mark, linestyle="-", color="b")
    plt.title(f"Number of Features vs Validation Loss (MSE) of {model_name}")
    plt.xlabel("Number of Features")
    plt.ylabel("Validation Loss (MSE)")
    plt.grid(True)
    plt.show()

plot_n_feature_val_loss(
    selector_lin_reg_cv,
    step=step_lin_reg,
    model_name="Linear Regression (Cross-Validation)",
    mark=None
)

def selector_result(selector, X_train_temp=X_train, y_train_temp=y_train,
                    X_test_temp=X_test, y_test_temp=y_test,
                    model_name="", print_out=True, predict=False):
    """
    Evaluate the selected model and print or return performance metrics.

    Parameters:
        selector: The RFECV selector object containing cv_results_ and estimator.
        X_train_temp (DataFrame): Training feature set.
        y_train_temp (Series): Training labels.
        X_test_temp (DataFrame): Testing feature set.
        y_test_temp (Series): Testing labels.
        model_name (str): Name of the model for display purposes.
        print_out (bool): If True, print the metrics.
        predict (bool): If True, return predictions instead of metrics.

    Returns:
        Tuple: (train MSE, test MSE, train RMSE, test RMSE) if predict is False,
               otherwise a list of predictions.
    """
    features = X_train_temp.columns[selector.support_]

    mse_bs_series = pd.Series(-selector.cv_results_["mean_test_score"])

    best_model = selector.estimator
    best_model.fit(X_train_temp[features], y_train_temp)
    best_model_mse_train = mean_squared_error(best_model.predict(X_train_temp[features]),
                                              y_train_temp)
    y_predict = best_model.predict(X_test_temp[features])
    best_model_mse_test = mean_squared_error(best_model.predict(X_test_temp[features]),
                                             y_test_temp)
    best_model_rmse_train = np.sqrt(best_model_mse_train)
    best_model_rmse_test = np.sqrt(best_model_mse_test)

    if print_out:
        print(f"Optimal number of features for {model_name}: {selector.n_features_}")
        print(f"Selected features for Linear {model_name}: {features}")
        print("Best Validation MSE:", mse_bs_series.min())
        print("-----------------------------")
        print(f"Best {model_name} Model Train MSE: {best_model_mse_train}")
        print(f"Best {model_name} Model Test MSE: {best_model_mse_test}")
        print(f"Best {model_name} Model Train RMSE: {best_model_rmse_train}")
        print(f"Best {model_name} Model Test RMSE: {best_model_rmse_test}")

    if not predict:
        return best_model_mse_train, best_model_mse_test, best_model_rmse_train, best_model_rmse_test
    else:
        return list(y_predict)


_ = selector_result(selector_lin_reg_cv, X_train, y_train, X_test, y_test, "Linear Regression (Cross-Validation)")
Optimal number of features for Linear Regression (Cross-Validation): 5
Selected features for Linear Linear Regression (Cross-Validation): Index(['TE3_day-1', 'TE1_day-4', 'TE2_day-4', 'DE5_day-4', 'DE6_day-4'], dtype='object')
Best Validation MSE: 0.00010527116357773034
-----------------------------
Best Linear Regression (Cross-Validation) Model Train MSE: 0.00012614083944832163
Best Linear Regression (Cross-Validation) Model Test MSE: 5.793372382508834e-05
Best Linear Regression (Cross-Validation) Model Train RMSE: 0.011231243895861297
Best Linear Regression (Cross-Validation) Model Test RMSE: 0.007611420618063906

3. Tree Based Models for Regression

We implement the same feature selection strategy for tree models

3.1 Decision Tree

3.1.1 Feature Selection

# Time Series Cross-Validation
tscv = TimeSeriesSplit(n_splits=3)

step_dt = 1

# Initialize RFECV
selector_dt = RFECV(
    estimator=DecisionTreeRegressor(max_depth=10, random_state=42),
    step=step_dt,  # Remove 1 feature at each step
    cv=tscv,      # Time series split
    verbose=1,
    n_jobs=-1,
    scoring='neg_mean_squared_error'  # Negative MSE for scoring
)

# Train and automatically select optimal number of features
selector_dt.fit(X_train, y_train)
Fitting estimator with 880 features.
Fitting estimator with 879 features.
Fitting estimator with 878 features.
Fitting estimator with 877 features.
Fitting estimator with 876 features.
Fitting estimator with 875 features.
Fitting estimator with 874 features.
Fitting estimator with 873 features.
Fitting estimator with 872 features.
Fitting estimator with 871 features.
Fitting estimator with 870 features.
Fitting estimator with 869 features.
Fitting estimator with 868 features.
Fitting estimator with 867 features.
Fitting estimator with 866 features.
Fitting estimator with 865 features.
Fitting estimator with 864 features.
Fitting estimator with 863 features.
Fitting estimator with 862 features.
Fitting estimator with 861 features.
Fitting estimator with 860 features.
Fitting estimator with 859 features.
Fitting estimator with 858 features.
Fitting estimator with 857 features.
Fitting estimator with 856 features.
Fitting estimator with 855 features.
Fitting estimator with 854 features.
Fitting estimator with 853 features.
Fitting estimator with 852 features.
Fitting estimator with 851 features.
Fitting estimator with 850 features.
Fitting estimator with 849 features.
Fitting estimator with 848 features.
Fitting estimator with 847 features.
Fitting estimator with 846 features.
Fitting estimator with 845 features.
Fitting estimator with 844 features.
Fitting estimator with 843 features.
Fitting estimator with 842 features.
Fitting estimator with 841 features.
Fitting estimator with 840 features.
Fitting estimator with 839 features.
Fitting estimator with 838 features.
Fitting estimator with 837 features.
Fitting estimator with 836 features.
Fitting estimator with 835 features.
Fitting estimator with 834 features.
Fitting estimator with 833 features.
Fitting estimator with 832 features.
Fitting estimator with 831 features.
Fitting estimator with 830 features.
Fitting estimator with 829 features.
Fitting estimator with 828 features.
Fitting estimator with 827 features.
Fitting estimator with 826 features.
Fitting estimator with 825 features.
Fitting estimator with 824 features.
Fitting estimator with 823 features.
Fitting estimator with 822 features.
Fitting estimator with 821 features.
Fitting estimator with 820 features.
Fitting estimator with 819 features.
Fitting estimator with 818 features.
Fitting estimator with 817 features.
Fitting estimator with 816 features.
Fitting estimator with 815 features.
Fitting estimator with 814 features.
Fitting estimator with 813 features.
Fitting estimator with 812 features.
Fitting estimator with 811 features.
Fitting estimator with 810 features.
Fitting estimator with 809 features.
Fitting estimator with 808 features.
Fitting estimator with 807 features.
Fitting estimator with 806 features.
Fitting estimator with 805 features.
Fitting estimator with 804 features.
Fitting estimator with 803 features.
Fitting estimator with 802 features.
Fitting estimator with 801 features.
Fitting estimator with 800 features.
Fitting estimator with 799 features.
Fitting estimator with 798 features.
Fitting estimator with 797 features.
Fitting estimator with 796 features.
Fitting estimator with 795 features.
Fitting estimator with 794 features.
Fitting estimator with 793 features.
Fitting estimator with 792 features.
Fitting estimator with 791 features.
Fitting estimator with 790 features.
Fitting estimator with 789 features.
Fitting estimator with 788 features.
Fitting estimator with 787 features.
Fitting estimator with 786 features.
Fitting estimator with 785 features.
Fitting estimator with 784 features.
Fitting estimator with 783 features.
Fitting estimator with 782 features.
Fitting estimator with 781 features.
Fitting estimator with 780 features.
Fitting estimator with 779 features.
Fitting estimator with 778 features.
Fitting estimator with 777 features.
Fitting estimator with 776 features.
Fitting estimator with 775 features.
Fitting estimator with 774 features.
Fitting estimator with 773 features.
Fitting estimator with 772 features.
Fitting estimator with 771 features.
Fitting estimator with 770 features.
Fitting estimator with 769 features.
Fitting estimator with 768 features.
Fitting estimator with 767 features.
Fitting estimator with 766 features.
Fitting estimator with 765 features.
Fitting estimator with 764 features.
Fitting estimator with 763 features.
Fitting estimator with 762 features.
Fitting estimator with 761 features.
Fitting estimator with 760 features.
Fitting estimator with 759 features.
Fitting estimator with 758 features.
Fitting estimator with 757 features.
Fitting estimator with 756 features.
Fitting estimator with 755 features.
Fitting estimator with 754 features.
Fitting estimator with 753 features.
Fitting estimator with 752 features.
Fitting estimator with 751 features.
Fitting estimator with 750 features.
Fitting estimator with 749 features.
Fitting estimator with 748 features.
Fitting estimator with 747 features.
Fitting estimator with 746 features.
Fitting estimator with 745 features.
Fitting estimator with 744 features.
Fitting estimator with 743 features.
Fitting estimator with 742 features.
Fitting estimator with 741 features.
Fitting estimator with 740 features.
Fitting estimator with 739 features.
Fitting estimator with 738 features.
Fitting estimator with 737 features.
Fitting estimator with 736 features.
Fitting estimator with 735 features.
Fitting estimator with 734 features.
Fitting estimator with 733 features.
Fitting estimator with 732 features.
Fitting estimator with 731 features.
Fitting estimator with 730 features.
Fitting estimator with 729 features.
Fitting estimator with 728 features.
Fitting estimator with 727 features.
Fitting estimator with 726 features.
Fitting estimator with 725 features.
Fitting estimator with 724 features.
Fitting estimator with 723 features.
Fitting estimator with 722 features.
Fitting estimator with 721 features.
Fitting estimator with 720 features.
Fitting estimator with 719 features.
Fitting estimator with 718 features.
Fitting estimator with 717 features.
Fitting estimator with 716 features.
Fitting estimator with 715 features.
Fitting estimator with 714 features.
Fitting estimator with 713 features.
Fitting estimator with 712 features.
Fitting estimator with 711 features.
Fitting estimator with 710 features.
Fitting estimator with 709 features.
Fitting estimator with 708 features.
Fitting estimator with 707 features.
Fitting estimator with 706 features.
Fitting estimator with 705 features.
Fitting estimator with 704 features.
Fitting estimator with 703 features.
Fitting estimator with 702 features.
Fitting estimator with 701 features.
Fitting estimator with 700 features.
Fitting estimator with 699 features.
Fitting estimator with 698 features.
Fitting estimator with 697 features.
Fitting estimator with 696 features.
Fitting estimator with 695 features.
Fitting estimator with 694 features.
Fitting estimator with 693 features.
Fitting estimator with 692 features.
Fitting estimator with 691 features.
Fitting estimator with 690 features.
Fitting estimator with 689 features.
Fitting estimator with 688 features.
Fitting estimator with 687 features.
Fitting estimator with 686 features.
Fitting estimator with 685 features.
Fitting estimator with 684 features.
Fitting estimator with 683 features.
Fitting estimator with 682 features.
Fitting estimator with 681 features.
Fitting estimator with 680 features.
Fitting estimator with 679 features.
Fitting estimator with 678 features.
Fitting estimator with 677 features.
Fitting estimator with 676 features.
Fitting estimator with 675 features.
Fitting estimator with 674 features.
Fitting estimator with 673 features.
Fitting estimator with 672 features.
Fitting estimator with 671 features.
Fitting estimator with 670 features.
Fitting estimator with 669 features.
Fitting estimator with 668 features.
Fitting estimator with 667 features.
Fitting estimator with 666 features.
Fitting estimator with 665 features.
Fitting estimator with 664 features.
Fitting estimator with 663 features.
Fitting estimator with 662 features.
Fitting estimator with 661 features.
Fitting estimator with 660 features.
Fitting estimator with 659 features.
Fitting estimator with 658 features.
Fitting estimator with 657 features.
Fitting estimator with 656 features.
Fitting estimator with 655 features.
Fitting estimator with 654 features.
Fitting estimator with 653 features.
Fitting estimator with 652 features.
Fitting estimator with 651 features.
Fitting estimator with 650 features.
Fitting estimator with 649 features.
Fitting estimator with 648 features.
Fitting estimator with 647 features.
Fitting estimator with 646 features.
Fitting estimator with 645 features.
Fitting estimator with 644 features.
Fitting estimator with 643 features.
Fitting estimator with 642 features.
Fitting estimator with 641 features.
Fitting estimator with 640 features.
Fitting estimator with 639 features.
Fitting estimator with 638 features.
Fitting estimator with 637 features.
Fitting estimator with 636 features.
Fitting estimator with 635 features.
Fitting estimator with 634 features.
Fitting estimator with 633 features.
Fitting estimator with 632 features.
Fitting estimator with 631 features.
Fitting estimator with 630 features.
Fitting estimator with 629 features.
Fitting estimator with 628 features.
Fitting estimator with 627 features.
Fitting estimator with 626 features.
Fitting estimator with 625 features.
Fitting estimator with 624 features.
Fitting estimator with 623 features.
Fitting estimator with 622 features.
Fitting estimator with 621 features.
Fitting estimator with 620 features.
Fitting estimator with 619 features.
Fitting estimator with 618 features.
Fitting estimator with 617 features.
Fitting estimator with 616 features.
Fitting estimator with 615 features.
Fitting estimator with 614 features.
Fitting estimator with 613 features.
Fitting estimator with 612 features.
Fitting estimator with 611 features.
Fitting estimator with 610 features.
Fitting estimator with 609 features.
Fitting estimator with 608 features.
Fitting estimator with 607 features.
Fitting estimator with 606 features.
Fitting estimator with 605 features.
Fitting estimator with 604 features.
Fitting estimator with 603 features.
Fitting estimator with 602 features.
Fitting estimator with 601 features.
Fitting estimator with 600 features.
Fitting estimator with 599 features.
Fitting estimator with 598 features.
Fitting estimator with 597 features.
Fitting estimator with 596 features.
Fitting estimator with 595 features.
Fitting estimator with 594 features.
Fitting estimator with 593 features.
Fitting estimator with 592 features.
Fitting estimator with 591 features.
Fitting estimator with 590 features.
Fitting estimator with 589 features.
Fitting estimator with 588 features.
Fitting estimator with 587 features.
Fitting estimator with 586 features.
Fitting estimator with 585 features.
Fitting estimator with 584 features.
Fitting estimator with 583 features.
Fitting estimator with 582 features.
Fitting estimator with 581 features.
Fitting estimator with 580 features.
Fitting estimator with 579 features.
Fitting estimator with 578 features.
Fitting estimator with 577 features.
Fitting estimator with 576 features.
Fitting estimator with 575 features.
Fitting estimator with 574 features.
Fitting estimator with 573 features.
Fitting estimator with 572 features.
Fitting estimator with 571 features.
Fitting estimator with 570 features.
Fitting estimator with 569 features.
Fitting estimator with 568 features.
Fitting estimator with 567 features.
Fitting estimator with 566 features.
Fitting estimator with 565 features.
Fitting estimator with 564 features.
Fitting estimator with 563 features.
Fitting estimator with 562 features.
Fitting estimator with 561 features.
Fitting estimator with 560 features.
Fitting estimator with 559 features.
Fitting estimator with 558 features.
Fitting estimator with 557 features.
Fitting estimator with 556 features.
Fitting estimator with 555 features.
Fitting estimator with 554 features.
Fitting estimator with 553 features.
Fitting estimator with 552 features.
Fitting estimator with 551 features.
Fitting estimator with 550 features.
Fitting estimator with 549 features.
Fitting estimator with 548 features.
Fitting estimator with 547 features.
Fitting estimator with 546 features.
Fitting estimator with 545 features.
Fitting estimator with 544 features.
Fitting estimator with 543 features.
Fitting estimator with 542 features.
Fitting estimator with 541 features.
Fitting estimator with 540 features.
Fitting estimator with 539 features.
Fitting estimator with 538 features.
Fitting estimator with 537 features.
Fitting estimator with 536 features.
Fitting estimator with 535 features.
Fitting estimator with 534 features.
Fitting estimator with 533 features.
Fitting estimator with 532 features.
Fitting estimator with 531 features.
Fitting estimator with 530 features.
Fitting estimator with 529 features.
Fitting estimator with 528 features.
Fitting estimator with 527 features.
Fitting estimator with 526 features.
Fitting estimator with 525 features.
Fitting estimator with 524 features.
Fitting estimator with 523 features.
Fitting estimator with 522 features.
Fitting estimator with 521 features.
Fitting estimator with 520 features.
Fitting estimator with 519 features.
Fitting estimator with 518 features.
Fitting estimator with 517 features.
Fitting estimator with 516 features.
Fitting estimator with 515 features.
Fitting estimator with 514 features.
Fitting estimator with 513 features.
Fitting estimator with 512 features.
Fitting estimator with 511 features.
Fitting estimator with 510 features.
Fitting estimator with 509 features.
Fitting estimator with 508 features.
Fitting estimator with 507 features.
Fitting estimator with 506 features.
Fitting estimator with 505 features.
Fitting estimator with 504 features.
Fitting estimator with 503 features.
Fitting estimator with 502 features.
Fitting estimator with 501 features.
Fitting estimator with 500 features.
Fitting estimator with 499 features.
Fitting estimator with 498 features.
Fitting estimator with 497 features.
Fitting estimator with 496 features.
Fitting estimator with 495 features.
Fitting estimator with 494 features.
Fitting estimator with 493 features.
Fitting estimator with 492 features.
Fitting estimator with 491 features.
Fitting estimator with 490 features.
Fitting estimator with 489 features.
Fitting estimator with 488 features.
Fitting estimator with 487 features.
Fitting estimator with 486 features.
Fitting estimator with 485 features.
Fitting estimator with 484 features.
Fitting estimator with 483 features.
Fitting estimator with 482 features.
Fitting estimator with 481 features.
Fitting estimator with 480 features.
Fitting estimator with 479 features.
Fitting estimator with 478 features.
Fitting estimator with 477 features.
Fitting estimator with 476 features.
Fitting estimator with 475 features.
Fitting estimator with 474 features.
Fitting estimator with 473 features.
Fitting estimator with 472 features.
Fitting estimator with 471 features.
Fitting estimator with 470 features.
Fitting estimator with 469 features.
Fitting estimator with 468 features.
Fitting estimator with 467 features.
Fitting estimator with 466 features.
Fitting estimator with 465 features.
Fitting estimator with 464 features.
Fitting estimator with 463 features.
Fitting estimator with 462 features.
Fitting estimator with 461 features.
Fitting estimator with 460 features.
Fitting estimator with 459 features.
Fitting estimator with 458 features.
Fitting estimator with 457 features.
Fitting estimator with 456 features.
Fitting estimator with 455 features.
Fitting estimator with 454 features.
Fitting estimator with 453 features.
Fitting estimator with 452 features.
Fitting estimator with 451 features.
Fitting estimator with 450 features.
Fitting estimator with 449 features.
Fitting estimator with 448 features.
Fitting estimator with 447 features.
Fitting estimator with 446 features.
Fitting estimator with 445 features.
Fitting estimator with 444 features.
Fitting estimator with 443 features.
Fitting estimator with 442 features.
Fitting estimator with 441 features.
Fitting estimator with 440 features.
Fitting estimator with 439 features.
Fitting estimator with 438 features.
Fitting estimator with 437 features.
Fitting estimator with 436 features.
Fitting estimator with 435 features.
Fitting estimator with 434 features.
Fitting estimator with 433 features.
Fitting estimator with 432 features.
Fitting estimator with 431 features.
Fitting estimator with 430 features.
Fitting estimator with 429 features.
Fitting estimator with 428 features.
Fitting estimator with 427 features.
Fitting estimator with 426 features.
Fitting estimator with 425 features.
Fitting estimator with 424 features.
Fitting estimator with 423 features.
Fitting estimator with 422 features.
Fitting estimator with 421 features.
Fitting estimator with 420 features.
Fitting estimator with 419 features.
Fitting estimator with 418 features.
Fitting estimator with 417 features.
Fitting estimator with 416 features.
Fitting estimator with 415 features.
Fitting estimator with 414 features.
Fitting estimator with 413 features.
Fitting estimator with 412 features.
Fitting estimator with 411 features.
Fitting estimator with 410 features.
Fitting estimator with 409 features.
Fitting estimator with 408 features.
Fitting estimator with 407 features.
Fitting estimator with 406 features.
Fitting estimator with 405 features.
Fitting estimator with 404 features.
Fitting estimator with 403 features.
Fitting estimator with 402 features.
Fitting estimator with 401 features.
Fitting estimator with 400 features.
Fitting estimator with 399 features.
Fitting estimator with 398 features.
Fitting estimator with 397 features.
Fitting estimator with 396 features.
Fitting estimator with 395 features.
Fitting estimator with 394 features.
Fitting estimator with 393 features.
Fitting estimator with 392 features.
Fitting estimator with 391 features.
Fitting estimator with 390 features.
Fitting estimator with 389 features.
Fitting estimator with 388 features.
Fitting estimator with 387 features.
Fitting estimator with 386 features.
Fitting estimator with 385 features.
Fitting estimator with 384 features.
Fitting estimator with 383 features.
Fitting estimator with 382 features.
Fitting estimator with 381 features.
Fitting estimator with 380 features.
Fitting estimator with 379 features.
Fitting estimator with 378 features.
Fitting estimator with 377 features.
Fitting estimator with 376 features.
Fitting estimator with 375 features.
Fitting estimator with 374 features.
Fitting estimator with 373 features.
Fitting estimator with 372 features.
Fitting estimator with 371 features.
Fitting estimator with 370 features.
Fitting estimator with 369 features.
Fitting estimator with 368 features.
Fitting estimator with 367 features.
Fitting estimator with 366 features.
Fitting estimator with 365 features.
Fitting estimator with 364 features.
Fitting estimator with 363 features.
Fitting estimator with 362 features.
Fitting estimator with 361 features.
Fitting estimator with 360 features.
Fitting estimator with 359 features.
Fitting estimator with 358 features.
Fitting estimator with 357 features.
Fitting estimator with 356 features.
Fitting estimator with 355 features.
Fitting estimator with 354 features.
Fitting estimator with 353 features.
Fitting estimator with 352 features.
Fitting estimator with 351 features.
Fitting estimator with 350 features.
Fitting estimator with 349 features.
Fitting estimator with 348 features.
Fitting estimator with 347 features.
Fitting estimator with 346 features.
Fitting estimator with 345 features.
Fitting estimator with 344 features.
Fitting estimator with 343 features.
Fitting estimator with 342 features.
Fitting estimator with 341 features.
Fitting estimator with 340 features.
Fitting estimator with 339 features.
Fitting estimator with 338 features.
Fitting estimator with 337 features.
Fitting estimator with 336 features.
Fitting estimator with 335 features.
Fitting estimator with 334 features.
Fitting estimator with 333 features.
Fitting estimator with 332 features.
Fitting estimator with 331 features.
Fitting estimator with 330 features.
Fitting estimator with 329 features.
Fitting estimator with 328 features.
Fitting estimator with 327 features.
Fitting estimator with 326 features.
Fitting estimator with 325 features.
Fitting estimator with 324 features.
Fitting estimator with 323 features.
Fitting estimator with 322 features.
Fitting estimator with 321 features.
Fitting estimator with 320 features.
Fitting estimator with 319 features.
Fitting estimator with 318 features.
Fitting estimator with 317 features.
Fitting estimator with 316 features.
Fitting estimator with 315 features.
Fitting estimator with 314 features.
Fitting estimator with 313 features.
Fitting estimator with 312 features.
Fitting estimator with 311 features.
Fitting estimator with 310 features.
Fitting estimator with 309 features.
Fitting estimator with 308 features.
Fitting estimator with 307 features.
Fitting estimator with 306 features.
Fitting estimator with 305 features.
Fitting estimator with 304 features.
Fitting estimator with 303 features.
Fitting estimator with 302 features.
Fitting estimator with 301 features.
Fitting estimator with 300 features.
Fitting estimator with 299 features.
Fitting estimator with 298 features.
Fitting estimator with 297 features.
Fitting estimator with 296 features.
Fitting estimator with 295 features.
Fitting estimator with 294 features.
Fitting estimator with 293 features.
Fitting estimator with 292 features.
Fitting estimator with 291 features.
Fitting estimator with 290 features.
Fitting estimator with 289 features.
Fitting estimator with 288 features.
Fitting estimator with 287 features.
Fitting estimator with 286 features.
Fitting estimator with 285 features.
Fitting estimator with 284 features.
Fitting estimator with 283 features.
Fitting estimator with 282 features.
Fitting estimator with 281 features.
Fitting estimator with 280 features.
Fitting estimator with 279 features.
Fitting estimator with 278 features.
Fitting estimator with 277 features.
Fitting estimator with 276 features.
Fitting estimator with 275 features.
Fitting estimator with 274 features.
Fitting estimator with 273 features.
Fitting estimator with 272 features.
Fitting estimator with 271 features.
Fitting estimator with 270 features.
Fitting estimator with 269 features.
Fitting estimator with 268 features.
Fitting estimator with 267 features.
Fitting estimator with 266 features.
Fitting estimator with 265 features.
Fitting estimator with 264 features.
Fitting estimator with 263 features.
Fitting estimator with 262 features.
Fitting estimator with 261 features.
Fitting estimator with 260 features.
Fitting estimator with 259 features.
Fitting estimator with 258 features.
Fitting estimator with 257 features.
Fitting estimator with 256 features.
Fitting estimator with 255 features.
Fitting estimator with 254 features.
Fitting estimator with 253 features.
Fitting estimator with 252 features.
Fitting estimator with 251 features.
Fitting estimator with 250 features.
Fitting estimator with 249 features.
Fitting estimator with 248 features.
Fitting estimator with 247 features.
Fitting estimator with 246 features.
Fitting estimator with 245 features.
Fitting estimator with 244 features.
Fitting estimator with 243 features.
Fitting estimator with 242 features.
Fitting estimator with 241 features.
Fitting estimator with 240 features.
Fitting estimator with 239 features.
Fitting estimator with 238 features.
Fitting estimator with 237 features.
Fitting estimator with 236 features.
Fitting estimator with 235 features.
Fitting estimator with 234 features.
Fitting estimator with 233 features.
Fitting estimator with 232 features.
Fitting estimator with 231 features.
Fitting estimator with 230 features.
Fitting estimator with 229 features.
Fitting estimator with 228 features.
Fitting estimator with 227 features.
Fitting estimator with 226 features.
Fitting estimator with 225 features.
Fitting estimator with 224 features.
Fitting estimator with 223 features.
Fitting estimator with 222 features.
Fitting estimator with 221 features.
Fitting estimator with 220 features.
Fitting estimator with 219 features.
Fitting estimator with 218 features.
Fitting estimator with 217 features.
Fitting estimator with 216 features.
Fitting estimator with 215 features.
Fitting estimator with 214 features.
Fitting estimator with 213 features.
Fitting estimator with 212 features.
Fitting estimator with 211 features.
Fitting estimator with 210 features.
Fitting estimator with 209 features.
Fitting estimator with 208 features.
Fitting estimator with 207 features.
Fitting estimator with 206 features.
Fitting estimator with 205 features.
Fitting estimator with 204 features.
Fitting estimator with 203 features.
Fitting estimator with 202 features.
Fitting estimator with 201 features.
Fitting estimator with 200 features.
Fitting estimator with 199 features.
Fitting estimator with 198 features.
Fitting estimator with 197 features.
Fitting estimator with 196 features.
Fitting estimator with 195 features.
Fitting estimator with 194 features.
Fitting estimator with 193 features.
Fitting estimator with 192 features.
Fitting estimator with 191 features.
Fitting estimator with 190 features.
Fitting estimator with 189 features.
Fitting estimator with 188 features.
Fitting estimator with 187 features.
Fitting estimator with 186 features.
Fitting estimator with 185 features.
Fitting estimator with 184 features.
Fitting estimator with 183 features.
Fitting estimator with 182 features.
Fitting estimator with 181 features.
Fitting estimator with 180 features.
Fitting estimator with 179 features.
Fitting estimator with 178 features.
Fitting estimator with 177 features.
Fitting estimator with 176 features.
Fitting estimator with 175 features.
Fitting estimator with 174 features.
Fitting estimator with 173 features.
Fitting estimator with 172 features.
Fitting estimator with 171 features.
Fitting estimator with 170 features.
Fitting estimator with 169 features.
Fitting estimator with 168 features.
Fitting estimator with 167 features.
Fitting estimator with 166 features.
Fitting estimator with 165 features.
Fitting estimator with 164 features.
Fitting estimator with 163 features.
Fitting estimator with 162 features.
Fitting estimator with 161 features.
Fitting estimator with 160 features.
Fitting estimator with 159 features.
Fitting estimator with 158 features.
Fitting estimator with 157 features.
Fitting estimator with 156 features.
Fitting estimator with 155 features.
Fitting estimator with 154 features.
Fitting estimator with 153 features.
Fitting estimator with 152 features.
Fitting estimator with 151 features.
Fitting estimator with 150 features.
Fitting estimator with 149 features.
Fitting estimator with 148 features.
Fitting estimator with 147 features.
Fitting estimator with 146 features.
Fitting estimator with 145 features.
Fitting estimator with 144 features.
Fitting estimator with 143 features.
Fitting estimator with 142 features.
Fitting estimator with 141 features.
Fitting estimator with 140 features.
Fitting estimator with 139 features.
Fitting estimator with 138 features.
Fitting estimator with 137 features.
Fitting estimator with 136 features.
Fitting estimator with 135 features.
Fitting estimator with 134 features.
Fitting estimator with 133 features.
Fitting estimator with 132 features.
Fitting estimator with 131 features.
Fitting estimator with 130 features.
Fitting estimator with 129 features.
Fitting estimator with 128 features.
Fitting estimator with 127 features.
Fitting estimator with 126 features.
Fitting estimator with 125 features.
Fitting estimator with 124 features.
Fitting estimator with 123 features.
Fitting estimator with 122 features.
Fitting estimator with 121 features.
Fitting estimator with 120 features.
Fitting estimator with 119 features.
Fitting estimator with 118 features.
Fitting estimator with 117 features.
Fitting estimator with 116 features.
Fitting estimator with 115 features.
Fitting estimator with 114 features.
Fitting estimator with 113 features.
Fitting estimator with 112 features.
Fitting estimator with 111 features.
Fitting estimator with 110 features.
Fitting estimator with 109 features.
Fitting estimator with 108 features.
Fitting estimator with 107 features.
Fitting estimator with 106 features.
Fitting estimator with 105 features.
Fitting estimator with 104 features.
Fitting estimator with 103 features.
Fitting estimator with 102 features.
Fitting estimator with 101 features.
Fitting estimator with 100 features.
Fitting estimator with 99 features.
Fitting estimator with 98 features.
Fitting estimator with 97 features.
Fitting estimator with 96 features.
Fitting estimator with 95 features.
Fitting estimator with 94 features.
Fitting estimator with 93 features.
Fitting estimator with 92 features.
Fitting estimator with 91 features.
Fitting estimator with 90 features.
Fitting estimator with 89 features.
Fitting estimator with 88 features.
Fitting estimator with 87 features.
Fitting estimator with 86 features.
Fitting estimator with 85 features.
Fitting estimator with 84 features.
Fitting estimator with 83 features.
Fitting estimator with 82 features.
Fitting estimator with 81 features.
Fitting estimator with 80 features.
Fitting estimator with 79 features.
Fitting estimator with 78 features.
Fitting estimator with 77 features.
Fitting estimator with 76 features.
Fitting estimator with 75 features.
Fitting estimator with 74 features.
Fitting estimator with 73 features.
Fitting estimator with 72 features.
Fitting estimator with 71 features.
Fitting estimator with 70 features.
Fitting estimator with 69 features.
Fitting estimator with 68 features.
Fitting estimator with 67 features.
Fitting estimator with 66 features.
Fitting estimator with 65 features.
Fitting estimator with 64 features.
Fitting estimator with 63 features.
Fitting estimator with 62 features.
Fitting estimator with 61 features.
Fitting estimator with 60 features.
Fitting estimator with 59 features.
Fitting estimator with 58 features.
Fitting estimator with 57 features.
Fitting estimator with 56 features.
Fitting estimator with 55 features.
Fitting estimator with 54 features.
Fitting estimator with 53 features.
Fitting estimator with 52 features.
Fitting estimator with 51 features.
Fitting estimator with 50 features.
Fitting estimator with 49 features.
Fitting estimator with 48 features.
Fitting estimator with 47 features.
Fitting estimator with 46 features.
Fitting estimator with 45 features.
Fitting estimator with 44 features.
Fitting estimator with 43 features.
Fitting estimator with 42 features.
Fitting estimator with 41 features.
Fitting estimator with 40 features.
Fitting estimator with 39 features.
Fitting estimator with 38 features.
Fitting estimator with 37 features.
Fitting estimator with 36 features.
Fitting estimator with 35 features.
Fitting estimator with 34 features.
Fitting estimator with 33 features.
Fitting estimator with 32 features.
Fitting estimator with 31 features.
Fitting estimator with 30 features.
Fitting estimator with 29 features.
Fitting estimator with 28 features.
Fitting estimator with 27 features.
Fitting estimator with 26 features.
Fitting estimator with 25 features.
Fitting estimator with 24 features.
Fitting estimator with 23 features.
Fitting estimator with 22 features.
Fitting estimator with 21 features.
Fitting estimator with 20 features.
Fitting estimator with 19 features.
Fitting estimator with 18 features.
Fitting estimator with 17 features.
Fitting estimator with 16 features.
Fitting estimator with 15 features.
Fitting estimator with 14 features.
Fitting estimator with 13 features.
Fitting estimator with 12 features.
Fitting estimator with 11 features.
Fitting estimator with 10 features.
Fitting estimator with 9 features.
Fitting estimator with 8 features.
Fitting estimator with 7 features.
Fitting estimator with 6 features.
Fitting estimator with 5 features.
Fitting estimator with 4 features.
Fitting estimator with 3 features.
RFECV(cv=TimeSeriesSplit(gap=0, max_train_size=None, n_splits=3, test_size=None),
      estimator=DecisionTreeRegressor(max_depth=10, random_state=42), n_jobs=-1,
      scoring='neg_mean_squared_error', verbose=1)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
# Save the model
joblib.dump(selector_dt, "selector_dt.joblib")
['selector_dt.joblib']
plot_n_feature_val_loss(selector_dt, step=step_dt, model_name='Decision Tree', mark=None)

_ = selector_result(selector_dt, X_train, y_train, X_test, y_test, "Decision Tree")
Optimal number of features for Decision Tree: 2
Selected features for Linear Decision Tree: Index(['ROC_10_day-1', 'NASDAQ-F_day-3'], dtype='object')
Best Validation MSE: 0.00013017646633121612
-----------------------------
Best Decision Tree Model Train MSE: 9.389818141190975e-05
Best Decision Tree Model Test MSE: 5.319664601451538e-05
Best Decision Tree Model Train RMSE: 0.00969010739940016
Best Decision Tree Model Test RMSE: 0.0072936030886329

3.1.2 Hyperparameter Optimization

# Get selected features
X_train_selected_dt = X_train.iloc[:, selector_dt.support_]

# Hyperparameter optimization
param_grid_dt = {
    'max_depth': [2, 3, 4, 6, 8, 10, None],
    'min_samples_split': [2, 3, 4, 6, 8, 10],
}
grid_search_dt = GridSearchCV(
    estimator=DecisionTreeRegressor(random_state=42),
    param_grid=param_grid_dt,
    cv=tscv,
    scoring='neg_mean_squared_error',
    n_jobs=-1,
    verbose=1,
)
grid_search_dt.fit(X_train_selected_dt, y_train)
Fitting 3 folds for each of 42 candidates, totalling 126 fits
GridSearchCV(cv=TimeSeriesSplit(gap=0, max_train_size=None, n_splits=3, test_size=None),
             estimator=DecisionTreeRegressor(random_state=42), n_jobs=-1,
             param_grid={'max_depth': [2, 3, 4, 6, 8, 10, None],
                         'min_samples_split': [2, 3, 4, 6, 8, 10]},
             scoring='neg_mean_squared_error', verbose=1)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
def two_hyperparameter_visualization(grid_search, hp1, hp2, model_name,
                                     criterion='mean_test_score',
                                     criterion_name='RMSE'):
    # Extract results
    results = grid_search.cv_results_
    mean_scores = np.sqrt(-results[criterion])  # Convert to positive RMSE
    param_1 = grid_search.param_grid[hp1]
    param_2 = grid_search.param_grid[hp2]

    # Reshape scores into a matrix
    scores_matrix = np.reshape(mean_scores, (len(param_1), len(param_2)))

    # Create a heatmap
    plt.figure(figsize=(10, 6))
    sns.heatmap(
        scores_matrix,
        annot=True,
        fmt=".3f",
        xticklabels=param_1,
        yticklabels=param_2,
        cmap="viridis",
    )
    plt.xlabel(hp1)
    plt.ylabel(hp2)
    plt.title(
        f"{model_name} Decision Tree Hyperparameter Tuning Results "
        f"({criterion_name})"
    )
    plt.show()


two_hyperparameter_visualization(
    grid_search_dt, 'max_depth', 'min_samples_split', 'Decision Tree'
)

# Evaluate the final model
best_model_dt_final = grid_search_dt.best_estimator_
best_model_dt_final.fit(
    X_train[X.columns[selector_dt.support_]], y_train
)

# Save the model
joblib.dump(best_model_dt_final, 'best_model_dt_final.joblib')


def grid_search_result(grid_search, selector, final_model, model_name='', print_out=True):
    best_model_mse_train_final = mean_squared_error(
        final_model.predict(X_train[X.columns[selector.support_]]), y_train
    )
    best_model_mse_test_final = mean_squared_error(
        final_model.predict(X_test[X.columns[selector.support_]]), y_test
    )
    best_model_rmse_train_final = np.sqrt(best_model_mse_train_final)
    best_model_rmse_test_final = np.sqrt(best_model_mse_test_final)

    if print_out:
        print(f"{model_name} Best hyperparameters:", grid_search.best_params_)
        print(f"{model_name} Best Validation MSE:", -grid_search.best_score_)
        print("-----------------------------")
        print(f"{model_name} Best Model Train MSE:", best_model_mse_train_final)
        print(f"{model_name} Best Model Test MSE:", best_model_mse_test_final)
        print(f"{model_name} Best Model Train RMSE:", best_model_rmse_train_final)
        print(f"{model_name} Best Model Test RMSE:", best_model_rmse_test_final)

    return (
        best_model_mse_train_final,
        best_model_mse_test_final,
        best_model_rmse_train_final,
        best_model_rmse_test_final,
    )


_ = grid_search_result(grid_search_dt, selector_dt, best_model_dt_final, 'Decision Tree')
Decision Tree Best hyperparameters: {'max_depth': 3, 'min_samples_split': 3}
Decision Tree Best Validation MSE: 0.00010894315706034298
-----------------------------
Decision Tree Best Model Train MSE: 0.00011617992780627547
Decision Tree Best Model Test MSE: 5.0685852201722405e-05
Decision Tree Best Model Train RMSE: 0.010778679316422558
Decision Tree Best Model Test RMSE: 0.007119399707961508

3.2 Random Forest

3.2.1 Feature Selection

Because of the limited computing resource we have, we remove 5 features at each step in the RFE process.

# Time Series Cross-Validation
tscv = TimeSeriesSplit(n_splits=3)

step_rf = 5

# Initialize RFECV, select some hyperparameters
selector_rf = RFECV(
    estimator=RandomForestRegressor(
        n_estimators=30,       # Fewer trees for speed (but not too few)
        max_depth=10,          # Limit tree depth to avoid overfitting
        max_samples=0.6,       # Use 60% of data per tree (balance speed and diversity)
        min_samples_split=10,  # Prevent splits on small nodes
        min_samples_leaf=15,   # Require larger leaves
        max_features='log2',   # log2(800) ≈ 9 features per split (faster than 'sqrt')
        n_jobs=-1,             # Use all CPU cores
        random_state=42,       # Reproducibility
        bootstrap=True,        # Bootstrap sampling for diversity
    ),
    step=step_rf,             # Remove 5 features at each step
    cv=tscv,                  # Time series split
    verbose=1,
    scoring='neg_mean_squared_error'  # Negative MSE for scoring
)

# Train and automatically select optimal number of features
selector_rf.fit(X_train, y_train)
Fitting estimator with 880 features.
Fitting estimator with 875 features.
Fitting estimator with 870 features.
Fitting estimator with 865 features.
Fitting estimator with 860 features.
Fitting estimator with 855 features.
Fitting estimator with 850 features.
Fitting estimator with 845 features.
Fitting estimator with 840 features.
Fitting estimator with 835 features.
Fitting estimator with 830 features.
Fitting estimator with 825 features.
Fitting estimator with 820 features.
Fitting estimator with 815 features.
Fitting estimator with 810 features.
Fitting estimator with 805 features.
Fitting estimator with 800 features.
Fitting estimator with 795 features.
Fitting estimator with 790 features.
Fitting estimator with 785 features.
Fitting estimator with 780 features.
Fitting estimator with 775 features.
Fitting estimator with 770 features.
Fitting estimator with 765 features.
Fitting estimator with 760 features.
Fitting estimator with 755 features.
Fitting estimator with 750 features.
Fitting estimator with 745 features.
Fitting estimator with 740 features.
Fitting estimator with 735 features.
Fitting estimator with 730 features.
Fitting estimator with 725 features.
Fitting estimator with 720 features.
Fitting estimator with 715 features.
Fitting estimator with 710 features.
Fitting estimator with 705 features.
Fitting estimator with 700 features.
Fitting estimator with 695 features.
Fitting estimator with 690 features.
Fitting estimator with 685 features.
Fitting estimator with 680 features.
Fitting estimator with 675 features.
Fitting estimator with 670 features.
Fitting estimator with 665 features.
Fitting estimator with 660 features.
Fitting estimator with 655 features.
Fitting estimator with 650 features.
Fitting estimator with 645 features.
Fitting estimator with 640 features.
Fitting estimator with 635 features.
Fitting estimator with 630 features.
Fitting estimator with 625 features.
Fitting estimator with 620 features.
Fitting estimator with 615 features.
Fitting estimator with 610 features.
Fitting estimator with 605 features.
Fitting estimator with 600 features.
Fitting estimator with 595 features.
Fitting estimator with 590 features.
Fitting estimator with 585 features.
Fitting estimator with 580 features.
Fitting estimator with 575 features.
Fitting estimator with 570 features.
Fitting estimator with 565 features.
Fitting estimator with 560 features.
Fitting estimator with 555 features.
Fitting estimator with 550 features.
Fitting estimator with 545 features.
Fitting estimator with 540 features.
Fitting estimator with 535 features.
Fitting estimator with 530 features.
Fitting estimator with 525 features.
Fitting estimator with 520 features.
Fitting estimator with 515 features.
Fitting estimator with 510 features.
Fitting estimator with 505 features.
Fitting estimator with 500 features.
Fitting estimator with 495 features.
Fitting estimator with 490 features.
Fitting estimator with 485 features.
Fitting estimator with 480 features.
Fitting estimator with 475 features.
Fitting estimator with 470 features.
Fitting estimator with 465 features.
Fitting estimator with 460 features.
Fitting estimator with 455 features.
Fitting estimator with 450 features.
Fitting estimator with 445 features.
Fitting estimator with 440 features.
Fitting estimator with 435 features.
Fitting estimator with 430 features.
Fitting estimator with 425 features.
Fitting estimator with 420 features.
Fitting estimator with 415 features.
Fitting estimator with 410 features.
Fitting estimator with 405 features.
Fitting estimator with 400 features.
Fitting estimator with 395 features.
Fitting estimator with 390 features.
Fitting estimator with 385 features.
Fitting estimator with 380 features.
Fitting estimator with 375 features.
Fitting estimator with 370 features.
Fitting estimator with 365 features.
Fitting estimator with 360 features.
Fitting estimator with 355 features.
Fitting estimator with 350 features.
Fitting estimator with 345 features.
Fitting estimator with 340 features.
Fitting estimator with 335 features.
Fitting estimator with 330 features.
Fitting estimator with 325 features.
Fitting estimator with 320 features.
Fitting estimator with 315 features.
Fitting estimator with 310 features.
Fitting estimator with 305 features.
Fitting estimator with 300 features.
Fitting estimator with 295 features.
Fitting estimator with 290 features.
Fitting estimator with 285 features.
Fitting estimator with 280 features.
Fitting estimator with 275 features.
Fitting estimator with 270 features.
Fitting estimator with 265 features.
Fitting estimator with 260 features.
Fitting estimator with 255 features.
Fitting estimator with 250 features.
Fitting estimator with 245 features.
Fitting estimator with 240 features.
Fitting estimator with 235 features.
Fitting estimator with 230 features.
Fitting estimator with 225 features.
Fitting estimator with 220 features.
Fitting estimator with 215 features.
Fitting estimator with 210 features.
Fitting estimator with 205 features.
Fitting estimator with 200 features.
Fitting estimator with 195 features.
Fitting estimator with 190 features.
Fitting estimator with 185 features.
Fitting estimator with 180 features.
Fitting estimator with 175 features.
Fitting estimator with 170 features.
Fitting estimator with 165 features.
Fitting estimator with 160 features.
Fitting estimator with 155 features.
Fitting estimator with 150 features.
Fitting estimator with 145 features.
Fitting estimator with 140 features.
Fitting estimator with 135 features.
Fitting estimator with 130 features.
Fitting estimator with 125 features.
Fitting estimator with 120 features.
Fitting estimator with 115 features.
Fitting estimator with 110 features.
Fitting estimator with 105 features.
Fitting estimator with 100 features.
Fitting estimator with 95 features.
Fitting estimator with 90 features.
Fitting estimator with 85 features.
Fitting estimator with 80 features.
Fitting estimator with 75 features.
Fitting estimator with 70 features.
Fitting estimator with 65 features.
Fitting estimator with 60 features.
Fitting estimator with 55 features.
Fitting estimator with 50 features.
Fitting estimator with 45 features.
Fitting estimator with 40 features.
Fitting estimator with 35 features.
Fitting estimator with 30 features.
Fitting estimator with 25 features.
Fitting estimator with 20 features.
Fitting estimator with 15 features.
Fitting estimator with 10 features.
Fitting estimator with 5 features.
Fitting estimator with 880 features.
Fitting estimator with 875 features.
Fitting estimator with 870 features.
Fitting estimator with 865 features.
Fitting estimator with 860 features.
Fitting estimator with 855 features.
Fitting estimator with 850 features.
Fitting estimator with 845 features.
Fitting estimator with 840 features.
Fitting estimator with 835 features.
Fitting estimator with 830 features.
Fitting estimator with 825 features.
Fitting estimator with 820 features.
Fitting estimator with 815 features.
Fitting estimator with 810 features.
Fitting estimator with 805 features.
Fitting estimator with 800 features.
Fitting estimator with 795 features.
Fitting estimator with 790 features.
Fitting estimator with 785 features.
Fitting estimator with 780 features.
Fitting estimator with 775 features.
Fitting estimator with 770 features.
Fitting estimator with 765 features.
Fitting estimator with 760 features.
Fitting estimator with 755 features.
Fitting estimator with 750 features.
Fitting estimator with 745 features.
Fitting estimator with 740 features.
Fitting estimator with 735 features.
Fitting estimator with 730 features.
Fitting estimator with 725 features.
Fitting estimator with 720 features.
Fitting estimator with 715 features.
Fitting estimator with 710 features.
Fitting estimator with 705 features.
Fitting estimator with 700 features.
Fitting estimator with 695 features.
Fitting estimator with 690 features.
Fitting estimator with 685 features.
Fitting estimator with 680 features.
Fitting estimator with 675 features.
Fitting estimator with 670 features.
Fitting estimator with 665 features.
Fitting estimator with 660 features.
Fitting estimator with 655 features.
Fitting estimator with 650 features.
Fitting estimator with 645 features.
Fitting estimator with 640 features.
Fitting estimator with 635 features.
Fitting estimator with 630 features.
Fitting estimator with 625 features.
Fitting estimator with 620 features.
Fitting estimator with 615 features.
Fitting estimator with 610 features.
Fitting estimator with 605 features.
Fitting estimator with 600 features.
Fitting estimator with 595 features.
Fitting estimator with 590 features.
Fitting estimator with 585 features.
Fitting estimator with 580 features.
Fitting estimator with 575 features.
Fitting estimator with 570 features.
Fitting estimator with 565 features.
Fitting estimator with 560 features.
Fitting estimator with 555 features.
Fitting estimator with 550 features.
Fitting estimator with 545 features.
Fitting estimator with 540 features.
Fitting estimator with 535 features.
Fitting estimator with 530 features.
Fitting estimator with 525 features.
Fitting estimator with 520 features.
Fitting estimator with 515 features.
Fitting estimator with 510 features.
Fitting estimator with 505 features.
Fitting estimator with 500 features.
Fitting estimator with 495 features.
Fitting estimator with 490 features.
Fitting estimator with 485 features.
Fitting estimator with 480 features.
Fitting estimator with 475 features.
Fitting estimator with 470 features.
Fitting estimator with 465 features.
Fitting estimator with 460 features.
Fitting estimator with 455 features.
Fitting estimator with 450 features.
Fitting estimator with 445 features.
Fitting estimator with 440 features.
Fitting estimator with 435 features.
Fitting estimator with 430 features.
Fitting estimator with 425 features.
Fitting estimator with 420 features.
Fitting estimator with 415 features.
Fitting estimator with 410 features.
Fitting estimator with 405 features.
Fitting estimator with 400 features.
Fitting estimator with 395 features.
Fitting estimator with 390 features.
Fitting estimator with 385 features.
Fitting estimator with 380 features.
Fitting estimator with 375 features.
Fitting estimator with 370 features.
Fitting estimator with 365 features.
Fitting estimator with 360 features.
Fitting estimator with 355 features.
Fitting estimator with 350 features.
Fitting estimator with 345 features.
Fitting estimator with 340 features.
Fitting estimator with 335 features.
Fitting estimator with 330 features.
Fitting estimator with 325 features.
Fitting estimator with 320 features.
Fitting estimator with 315 features.
Fitting estimator with 310 features.
Fitting estimator with 305 features.
Fitting estimator with 300 features.
Fitting estimator with 295 features.
Fitting estimator with 290 features.
Fitting estimator with 285 features.
Fitting estimator with 280 features.
Fitting estimator with 275 features.
Fitting estimator with 270 features.
Fitting estimator with 265 features.
Fitting estimator with 260 features.
Fitting estimator with 255 features.
Fitting estimator with 250 features.
Fitting estimator with 245 features.
Fitting estimator with 240 features.
Fitting estimator with 235 features.
Fitting estimator with 230 features.
Fitting estimator with 225 features.
Fitting estimator with 220 features.
Fitting estimator with 215 features.
Fitting estimator with 210 features.
Fitting estimator with 205 features.
Fitting estimator with 200 features.
Fitting estimator with 195 features.
Fitting estimator with 190 features.
Fitting estimator with 185 features.
Fitting estimator with 180 features.
Fitting estimator with 175 features.
Fitting estimator with 170 features.
Fitting estimator with 165 features.
Fitting estimator with 160 features.
Fitting estimator with 155 features.
Fitting estimator with 150 features.
Fitting estimator with 145 features.
Fitting estimator with 140 features.
Fitting estimator with 135 features.
Fitting estimator with 130 features.
Fitting estimator with 125 features.
Fitting estimator with 120 features.
Fitting estimator with 115 features.
Fitting estimator with 110 features.
Fitting estimator with 105 features.
Fitting estimator with 100 features.
Fitting estimator with 95 features.
Fitting estimator with 90 features.
Fitting estimator with 85 features.
Fitting estimator with 80 features.
Fitting estimator with 75 features.
Fitting estimator with 70 features.
Fitting estimator with 65 features.
Fitting estimator with 60 features.
Fitting estimator with 55 features.
Fitting estimator with 50 features.
Fitting estimator with 45 features.
Fitting estimator with 40 features.
Fitting estimator with 35 features.
Fitting estimator with 30 features.
Fitting estimator with 25 features.
Fitting estimator with 20 features.
Fitting estimator with 15 features.
Fitting estimator with 10 features.
Fitting estimator with 5 features.
Fitting estimator with 880 features.
Fitting estimator with 875 features.
Fitting estimator with 870 features.
Fitting estimator with 865 features.
Fitting estimator with 860 features.
Fitting estimator with 855 features.
Fitting estimator with 850 features.
Fitting estimator with 845 features.
Fitting estimator with 840 features.
Fitting estimator with 835 features.
Fitting estimator with 830 features.
Fitting estimator with 825 features.
Fitting estimator with 820 features.
Fitting estimator with 815 features.
Fitting estimator with 810 features.
Fitting estimator with 805 features.
Fitting estimator with 800 features.
Fitting estimator with 795 features.
Fitting estimator with 790 features.
Fitting estimator with 785 features.
Fitting estimator with 780 features.
Fitting estimator with 775 features.
Fitting estimator with 770 features.
Fitting estimator with 765 features.
Fitting estimator with 760 features.
Fitting estimator with 755 features.
Fitting estimator with 750 features.
Fitting estimator with 745 features.
Fitting estimator with 740 features.
Fitting estimator with 735 features.
Fitting estimator with 730 features.
Fitting estimator with 725 features.
Fitting estimator with 720 features.
Fitting estimator with 715 features.
Fitting estimator with 710 features.
Fitting estimator with 705 features.
Fitting estimator with 700 features.
Fitting estimator with 695 features.
Fitting estimator with 690 features.
Fitting estimator with 685 features.
Fitting estimator with 680 features.
Fitting estimator with 675 features.
Fitting estimator with 670 features.
Fitting estimator with 665 features.
Fitting estimator with 660 features.
Fitting estimator with 655 features.
Fitting estimator with 650 features.
Fitting estimator with 645 features.
Fitting estimator with 640 features.
Fitting estimator with 635 features.
Fitting estimator with 630 features.
Fitting estimator with 625 features.
Fitting estimator with 620 features.
Fitting estimator with 615 features.
Fitting estimator with 610 features.
Fitting estimator with 605 features.
Fitting estimator with 600 features.
Fitting estimator with 595 features.
Fitting estimator with 590 features.
Fitting estimator with 585 features.
Fitting estimator with 580 features.
Fitting estimator with 575 features.
Fitting estimator with 570 features.
Fitting estimator with 565 features.
Fitting estimator with 560 features.
Fitting estimator with 555 features.
Fitting estimator with 550 features.
Fitting estimator with 545 features.
Fitting estimator with 540 features.
Fitting estimator with 535 features.
Fitting estimator with 530 features.
Fitting estimator with 525 features.
Fitting estimator with 520 features.
Fitting estimator with 515 features.
Fitting estimator with 510 features.
Fitting estimator with 505 features.
Fitting estimator with 500 features.
Fitting estimator with 495 features.
Fitting estimator with 490 features.
Fitting estimator with 485 features.
Fitting estimator with 480 features.
Fitting estimator with 475 features.
Fitting estimator with 470 features.
Fitting estimator with 465 features.
Fitting estimator with 460 features.
Fitting estimator with 455 features.
Fitting estimator with 450 features.
Fitting estimator with 445 features.
Fitting estimator with 440 features.
Fitting estimator with 435 features.
Fitting estimator with 430 features.
Fitting estimator with 425 features.
Fitting estimator with 420 features.
Fitting estimator with 415 features.
Fitting estimator with 410 features.
Fitting estimator with 405 features.
Fitting estimator with 400 features.
Fitting estimator with 395 features.
Fitting estimator with 390 features.
Fitting estimator with 385 features.
Fitting estimator with 380 features.
Fitting estimator with 375 features.
Fitting estimator with 370 features.
Fitting estimator with 365 features.
Fitting estimator with 360 features.
Fitting estimator with 355 features.
Fitting estimator with 350 features.
Fitting estimator with 345 features.
Fitting estimator with 340 features.
Fitting estimator with 335 features.
Fitting estimator with 330 features.
Fitting estimator with 325 features.
Fitting estimator with 320 features.
Fitting estimator with 315 features.
Fitting estimator with 310 features.
Fitting estimator with 305 features.
Fitting estimator with 300 features.
Fitting estimator with 295 features.
Fitting estimator with 290 features.
Fitting estimator with 285 features.
Fitting estimator with 280 features.
Fitting estimator with 275 features.
Fitting estimator with 270 features.
Fitting estimator with 265 features.
Fitting estimator with 260 features.
Fitting estimator with 255 features.
Fitting estimator with 250 features.
Fitting estimator with 245 features.
Fitting estimator with 240 features.
Fitting estimator with 235 features.
Fitting estimator with 230 features.
Fitting estimator with 225 features.
Fitting estimator with 220 features.
Fitting estimator with 215 features.
Fitting estimator with 210 features.
Fitting estimator with 205 features.
Fitting estimator with 200 features.
Fitting estimator with 195 features.
Fitting estimator with 190 features.
Fitting estimator with 185 features.
Fitting estimator with 180 features.
Fitting estimator with 175 features.
Fitting estimator with 170 features.
Fitting estimator with 165 features.
Fitting estimator with 160 features.
Fitting estimator with 155 features.
Fitting estimator with 150 features.
Fitting estimator with 145 features.
Fitting estimator with 140 features.
Fitting estimator with 135 features.
Fitting estimator with 130 features.
Fitting estimator with 125 features.
Fitting estimator with 120 features.
Fitting estimator with 115 features.
Fitting estimator with 110 features.
Fitting estimator with 105 features.
Fitting estimator with 100 features.
Fitting estimator with 95 features.
Fitting estimator with 90 features.
Fitting estimator with 85 features.
Fitting estimator with 80 features.
Fitting estimator with 75 features.
Fitting estimator with 70 features.
Fitting estimator with 65 features.
Fitting estimator with 60 features.
Fitting estimator with 55 features.
Fitting estimator with 50 features.
Fitting estimator with 45 features.
Fitting estimator with 40 features.
Fitting estimator with 35 features.
Fitting estimator with 30 features.
Fitting estimator with 25 features.
Fitting estimator with 20 features.
Fitting estimator with 15 features.
Fitting estimator with 10 features.
Fitting estimator with 5 features.
Fitting estimator with 880 features.
Fitting estimator with 875 features.
Fitting estimator with 870 features.
Fitting estimator with 865 features.
Fitting estimator with 860 features.
Fitting estimator with 855 features.
Fitting estimator with 850 features.
Fitting estimator with 845 features.
Fitting estimator with 840 features.
Fitting estimator with 835 features.
Fitting estimator with 830 features.
Fitting estimator with 825 features.
Fitting estimator with 820 features.
Fitting estimator with 815 features.
Fitting estimator with 810 features.
Fitting estimator with 805 features.
Fitting estimator with 800 features.
Fitting estimator with 795 features.
Fitting estimator with 790 features.
Fitting estimator with 785 features.
Fitting estimator with 780 features.
Fitting estimator with 775 features.
Fitting estimator with 770 features.
Fitting estimator with 765 features.
Fitting estimator with 760 features.
Fitting estimator with 755 features.
Fitting estimator with 750 features.
Fitting estimator with 745 features.
Fitting estimator with 740 features.
Fitting estimator with 735 features.
Fitting estimator with 730 features.
Fitting estimator with 725 features.
Fitting estimator with 720 features.
Fitting estimator with 715 features.
Fitting estimator with 710 features.
Fitting estimator with 705 features.
Fitting estimator with 700 features.
Fitting estimator with 695 features.
Fitting estimator with 690 features.
Fitting estimator with 685 features.
Fitting estimator with 680 features.
Fitting estimator with 675 features.
Fitting estimator with 670 features.
Fitting estimator with 665 features.
Fitting estimator with 660 features.
Fitting estimator with 655 features.
Fitting estimator with 650 features.
Fitting estimator with 645 features.
Fitting estimator with 640 features.
Fitting estimator with 635 features.
Fitting estimator with 630 features.
Fitting estimator with 625 features.
Fitting estimator with 620 features.
Fitting estimator with 615 features.
Fitting estimator with 610 features.
Fitting estimator with 605 features.
Fitting estimator with 600 features.
Fitting estimator with 595 features.
Fitting estimator with 590 features.
Fitting estimator with 585 features.
Fitting estimator with 580 features.
Fitting estimator with 575 features.
Fitting estimator with 570 features.
Fitting estimator with 565 features.
Fitting estimator with 560 features.
Fitting estimator with 555 features.
Fitting estimator with 550 features.
Fitting estimator with 545 features.
Fitting estimator with 540 features.
RFECV(cv=TimeSeriesSplit(gap=0, max_train_size=None, n_splits=3, test_size=None),
      estimator=RandomForestRegressor(max_depth=10, max_features='log2',
                                      max_samples=0.6, min_samples_leaf=15,
                                      min_samples_split=10, n_estimators=30,
                                      n_jobs=-1, random_state=42),
      scoring='neg_mean_squared_error', step=5, verbose=1)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
# Save the model
joblib.dump(selector_rf, 'selector_rf.joblib')
['selector_rf.joblib']
plot_n_feature_val_loss(selector_rf, step=step_rf, model_name='Random Forest', mark='x')

selector_result(selector_rf, X_train, y_train, X_test, y_test, 'Random Forest')
Optimal number of features for Random Forest: 535
Selected features for Linear Random Forest: Index(['ROC_20_day-1', 'ROC_20_day-1^2', 'EMA_10_day-1', 'EMA_10_day-1^2',
       'EMA_20_day-1', 'EMA_20_day-1^2', 'EMA_50_day-1', 'EMA_50_day-1^2',
       'DTB4WK_day-1', 'DTB4WK_day-1^2',
       ...
       'Dollar index-F_day-5^2', 'Dollar index_day-5', 'Dollar index_day-5^2',
       'wheat-F_day-5', 'wheat-F_day-5^2', 'XAG_day-5', 'XAG_day-5^2',
       'XAU_day-5', 'XAU_day-5^2', 'day_of_week_day-5'],
      dtype='object', length=535)
Best Validation MSE: 0.00010155466999754498
-----------------------------
Best Random Forest Model Train MSE: 0.00010452561376682597
Best Random Forest Model Test MSE: 5.417641101158336e-05
Best Random Forest Model Train RMSE: 0.010223776883658307
Best Random Forest Model Test RMSE: 0.007360462690047641
(0.00010452561376682597,
 5.417641101158336e-05,
 0.010223776883658307,
 0.007360462690047641)

3.2.2 Hyperparameter Optimization

# Get selected features
X_train_selected_rf = X_train.iloc[:, selector_rf.support_]

# Hyperparameter optimization
param_grid_rf = {
    'n_estimators': [50, 100, 150],      # Fewer trees than default (balance speed and stability)
    'max_depth': [5, 10, 15],            # Shallower trees to prevent overfitting
    'min_samples_split': [10, 20, 30],   # Larger splits for noisy data
    'min_samples_leaf': [5, 10, 15],     # Larger leaves for regularization
    'max_features': ['log2', 0.05],      # Fewer features per split (critical for high dimensions)
    'bootstrap': [True],               # Bootstrap sampling for robustness
    'max_samples': [0.6, 0.8],           # Subsample data to increase diversity
}
grid_search_rf = GridSearchCV(
    estimator=RandomForestRegressor(n_jobs=-1),
    param_grid=param_grid_rf,
    cv=tscv,
    scoring='neg_mean_squared_error',
    verbose=1,
)
grid_search_rf.fit(X_train_selected_rf, y_train)
Fitting 3 folds for each of 324 candidates, totalling 972 fits
GridSearchCV(cv=TimeSeriesSplit(gap=0, max_train_size=None, n_splits=3, test_size=None),
             estimator=RandomForestRegressor(n_jobs=-1),
             param_grid={'bootstrap': [True], 'max_depth': [5, 10, 15],
                         'max_features': ['log2', 0.05],
                         'max_samples': [0.6, 0.8],
                         'min_samples_leaf': [5, 10, 15],
                         'min_samples_split': [10, 20, 30],
                         'n_estimators': [50, 100, 150]},
             scoring='neg_mean_squared_error', verbose=1)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.

Here’s the optimized parameters for random forest.

# Evaluate the final model
best_model_rf_final = grid_search_rf.best_estimator_
best_model_rf_final.fit(X_train[X.columns[selector_rf.support_]], y_train)

# Save the model
joblib.dump(best_model_rf_final, 'best_model_rf_final.joblib')

_ = grid_search_result(grid_search_rf, selector_rf, best_model_rf_final, 'Random Forest')
Random Forest Best hyperparameters: {'bootstrap': True, 'max_depth': 5, 'max_features': 'log2', 'max_samples': 0.8, 'min_samples_leaf': 15, 'min_samples_split': 10, 'n_estimators': 50}
Random Forest Best Validation MSE: 0.00010222025743517132
-----------------------------
Random Forest Best Model Train MSE: 0.00011301699070842933
Random Forest Best Model Test MSE: 5.164476926179037e-05
Random Forest Best Model Train RMSE: 0.010630944958395248
Random Forest Best Model Test RMSE: 0.0071864295211036735

3.3 XGBoost

3.3.1 Feature Selection

# Time Series Cross-Validation
tscv = TimeSeriesSplit(n_splits=3)

step_xgb = 5

# Initialize RFECV
selector_xgb = RFECV(
    estimator=XGBRegressor(
        n_estimators=50,  # Number of trees (balance speed and performance)
        max_depth=5,  # Limit tree depth to prevent overfitting
        subsample=0.8,  # Use 80% of samples per tree (introduce diversity)
        min_child_weight=3,  # Minimum sum of instance weights (controls splits)
        tree_method='hist',  # Histogram-based tree method (faster than 'exact')
        device='cuda',  # Use GPU for training (if available)
        random_state=42,  # Reproducibility
        n_jobs=-1  # Use all CPU cores for parallel processing
    ),
    step=step_xgb,  # Remove 5 features at each step
    cv=tscv,  # Time series split
    verbose=1,
    scoring='neg_mean_squared_error'  # Negative MSE for scoring
)

# Train and automatically select optimal number of features
selector_xgb.fit(X_train, y_train)

Fitting estimator with 880 features.
C:\Users\zln92\AppData\Roaming\Python\Python311\site-packages\xgboost\core.py:158: UserWarning: [19:22:12] WARNING: C:\buildkite-agent\builds\buildkite-windows-cpu-autoscaling-group-i-08cbc0333d8d4aae1-1\xgboost\xgboost-ci-windows\src\common\error_msg.cc:58: Falling back to prediction using DMatrix due to mismatched devices. This might lead to higher memory usage and slower performance. XGBoost is running on: cuda:0, while the input data is on: cpu.
Potential solutions:
- Use a data structure that matches the device ordinal in the booster.
- Set the device for booster before call to inplace_predict.

This warning will only be shown once.

  warnings.warn(smsg, UserWarning)
Fitting estimator with 875 features.
Fitting estimator with 870 features.
Fitting estimator with 865 features.
Fitting estimator with 860 features.
Fitting estimator with 855 features.
Fitting estimator with 850 features.
Fitting estimator with 845 features.
Fitting estimator with 840 features.
Fitting estimator with 835 features.
Fitting estimator with 830 features.
Fitting estimator with 825 features.
Fitting estimator with 820 features.
Fitting estimator with 815 features.
Fitting estimator with 810 features.
Fitting estimator with 805 features.
Fitting estimator with 800 features.
Fitting estimator with 795 features.
Fitting estimator with 790 features.
Fitting estimator with 785 features.
Fitting estimator with 780 features.
Fitting estimator with 775 features.
Fitting estimator with 770 features.
Fitting estimator with 765 features.
Fitting estimator with 760 features.
Fitting estimator with 755 features.
Fitting estimator with 750 features.
Fitting estimator with 745 features.
Fitting estimator with 740 features.
Fitting estimator with 735 features.
Fitting estimator with 730 features.
Fitting estimator with 725 features.
Fitting estimator with 720 features.
Fitting estimator with 715 features.
Fitting estimator with 710 features.
Fitting estimator with 705 features.
Fitting estimator with 700 features.
Fitting estimator with 695 features.
Fitting estimator with 690 features.
Fitting estimator with 685 features.
Fitting estimator with 680 features.
Fitting estimator with 675 features.
Fitting estimator with 670 features.
Fitting estimator with 665 features.
Fitting estimator with 660 features.
Fitting estimator with 655 features.
Fitting estimator with 650 features.
Fitting estimator with 645 features.
Fitting estimator with 640 features.
Fitting estimator with 635 features.
Fitting estimator with 630 features.
Fitting estimator with 625 features.
Fitting estimator with 620 features.
Fitting estimator with 615 features.
Fitting estimator with 610 features.
Fitting estimator with 605 features.
Fitting estimator with 600 features.
Fitting estimator with 595 features.
Fitting estimator with 590 features.
Fitting estimator with 585 features.
Fitting estimator with 580 features.
Fitting estimator with 575 features.
Fitting estimator with 570 features.
Fitting estimator with 565 features.
Fitting estimator with 560 features.
Fitting estimator with 555 features.
Fitting estimator with 550 features.
Fitting estimator with 545 features.
Fitting estimator with 540 features.
Fitting estimator with 535 features.
Fitting estimator with 530 features.
Fitting estimator with 525 features.
Fitting estimator with 520 features.
Fitting estimator with 515 features.
Fitting estimator with 510 features.
Fitting estimator with 505 features.
Fitting estimator with 500 features.
Fitting estimator with 495 features.
Fitting estimator with 490 features.
Fitting estimator with 485 features.
Fitting estimator with 480 features.
Fitting estimator with 475 features.
Fitting estimator with 470 features.
Fitting estimator with 465 features.
Fitting estimator with 460 features.
Fitting estimator with 455 features.
Fitting estimator with 450 features.
Fitting estimator with 445 features.
Fitting estimator with 440 features.
Fitting estimator with 435 features.
Fitting estimator with 430 features.
Fitting estimator with 425 features.
Fitting estimator with 420 features.
Fitting estimator with 415 features.
Fitting estimator with 410 features.
Fitting estimator with 405 features.
Fitting estimator with 400 features.
Fitting estimator with 395 features.
Fitting estimator with 390 features.
Fitting estimator with 385 features.
Fitting estimator with 380 features.
Fitting estimator with 375 features.
Fitting estimator with 370 features.
Fitting estimator with 365 features.
Fitting estimator with 360 features.
Fitting estimator with 355 features.
Fitting estimator with 350 features.
Fitting estimator with 345 features.
Fitting estimator with 340 features.
Fitting estimator with 335 features.
Fitting estimator with 330 features.
Fitting estimator with 325 features.
Fitting estimator with 320 features.
Fitting estimator with 315 features.
Fitting estimator with 310 features.
Fitting estimator with 305 features.
Fitting estimator with 300 features.
Fitting estimator with 295 features.
Fitting estimator with 290 features.
Fitting estimator with 285 features.
Fitting estimator with 280 features.
Fitting estimator with 275 features.
Fitting estimator with 270 features.
Fitting estimator with 265 features.
Fitting estimator with 260 features.
Fitting estimator with 255 features.
Fitting estimator with 250 features.
Fitting estimator with 245 features.
Fitting estimator with 240 features.
Fitting estimator with 235 features.
Fitting estimator with 230 features.
Fitting estimator with 225 features.
Fitting estimator with 220 features.
Fitting estimator with 215 features.
Fitting estimator with 210 features.
Fitting estimator with 205 features.
Fitting estimator with 200 features.
Fitting estimator with 195 features.
Fitting estimator with 190 features.
Fitting estimator with 185 features.
Fitting estimator with 180 features.
Fitting estimator with 175 features.
Fitting estimator with 170 features.
Fitting estimator with 165 features.
Fitting estimator with 160 features.
Fitting estimator with 155 features.
Fitting estimator with 150 features.
Fitting estimator with 145 features.
Fitting estimator with 140 features.
Fitting estimator with 135 features.
Fitting estimator with 130 features.
Fitting estimator with 125 features.
Fitting estimator with 120 features.
Fitting estimator with 115 features.
Fitting estimator with 110 features.
Fitting estimator with 105 features.
Fitting estimator with 100 features.
Fitting estimator with 95 features.
Fitting estimator with 90 features.
Fitting estimator with 85 features.
Fitting estimator with 80 features.
Fitting estimator with 75 features.
Fitting estimator with 70 features.
Fitting estimator with 65 features.
Fitting estimator with 60 features.
Fitting estimator with 55 features.
Fitting estimator with 50 features.
Fitting estimator with 45 features.
Fitting estimator with 40 features.
Fitting estimator with 35 features.
Fitting estimator with 30 features.
Fitting estimator with 25 features.
Fitting estimator with 20 features.
Fitting estimator with 15 features.
Fitting estimator with 10 features.
Fitting estimator with 5 features.
Fitting estimator with 880 features.
Fitting estimator with 875 features.
Fitting estimator with 870 features.
Fitting estimator with 865 features.
Fitting estimator with 860 features.
Fitting estimator with 855 features.
Fitting estimator with 850 features.
Fitting estimator with 845 features.
Fitting estimator with 840 features.
Fitting estimator with 835 features.
Fitting estimator with 830 features.
Fitting estimator with 825 features.
Fitting estimator with 820 features.
Fitting estimator with 815 features.
Fitting estimator with 810 features.
Fitting estimator with 805 features.
Fitting estimator with 800 features.
Fitting estimator with 795 features.
Fitting estimator with 790 features.
Fitting estimator with 785 features.
Fitting estimator with 780 features.
Fitting estimator with 775 features.
Fitting estimator with 770 features.
Fitting estimator with 765 features.
Fitting estimator with 760 features.
Fitting estimator with 755 features.
Fitting estimator with 750 features.
Fitting estimator with 745 features.
Fitting estimator with 740 features.
Fitting estimator with 735 features.
Fitting estimator with 730 features.
Fitting estimator with 725 features.
Fitting estimator with 720 features.
Fitting estimator with 715 features.
Fitting estimator with 710 features.
Fitting estimator with 705 features.
Fitting estimator with 700 features.
Fitting estimator with 695 features.
Fitting estimator with 690 features.
Fitting estimator with 685 features.
Fitting estimator with 680 features.
Fitting estimator with 675 features.
Fitting estimator with 670 features.
Fitting estimator with 665 features.
Fitting estimator with 660 features.
Fitting estimator with 655 features.
Fitting estimator with 650 features.
Fitting estimator with 645 features.
Fitting estimator with 640 features.
Fitting estimator with 635 features.
Fitting estimator with 630 features.
Fitting estimator with 625 features.
Fitting estimator with 620 features.
Fitting estimator with 615 features.
Fitting estimator with 610 features.
Fitting estimator with 605 features.
Fitting estimator with 600 features.
Fitting estimator with 595 features.
Fitting estimator with 590 features.
Fitting estimator with 585 features.
Fitting estimator with 580 features.
Fitting estimator with 575 features.
Fitting estimator with 570 features.
Fitting estimator with 565 features.
Fitting estimator with 560 features.
Fitting estimator with 555 features.
Fitting estimator with 550 features.
Fitting estimator with 545 features.
Fitting estimator with 540 features.
Fitting estimator with 535 features.
Fitting estimator with 530 features.
Fitting estimator with 525 features.
Fitting estimator with 520 features.
Fitting estimator with 515 features.
Fitting estimator with 510 features.
Fitting estimator with 505 features.
Fitting estimator with 500 features.
Fitting estimator with 495 features.
Fitting estimator with 490 features.
Fitting estimator with 485 features.
Fitting estimator with 480 features.
Fitting estimator with 475 features.
Fitting estimator with 470 features.
Fitting estimator with 465 features.
Fitting estimator with 460 features.
Fitting estimator with 455 features.
Fitting estimator with 450 features.
Fitting estimator with 445 features.
Fitting estimator with 440 features.
Fitting estimator with 435 features.
Fitting estimator with 430 features.
Fitting estimator with 425 features.
Fitting estimator with 420 features.
Fitting estimator with 415 features.
Fitting estimator with 410 features.
Fitting estimator with 405 features.
Fitting estimator with 400 features.
Fitting estimator with 395 features.
Fitting estimator with 390 features.
Fitting estimator with 385 features.
Fitting estimator with 380 features.
Fitting estimator with 375 features.
Fitting estimator with 370 features.
Fitting estimator with 365 features.
Fitting estimator with 360 features.
Fitting estimator with 355 features.
Fitting estimator with 350 features.
Fitting estimator with 345 features.
Fitting estimator with 340 features.
Fitting estimator with 335 features.
Fitting estimator with 330 features.
Fitting estimator with 325 features.
Fitting estimator with 320 features.
Fitting estimator with 315 features.
Fitting estimator with 310 features.
Fitting estimator with 305 features.
Fitting estimator with 300 features.
Fitting estimator with 295 features.
Fitting estimator with 290 features.
Fitting estimator with 285 features.
Fitting estimator with 280 features.
Fitting estimator with 275 features.
Fitting estimator with 270 features.
Fitting estimator with 265 features.
Fitting estimator with 260 features.
Fitting estimator with 255 features.
Fitting estimator with 250 features.
Fitting estimator with 245 features.
Fitting estimator with 240 features.
Fitting estimator with 235 features.
Fitting estimator with 230 features.
Fitting estimator with 225 features.
Fitting estimator with 220 features.
Fitting estimator with 215 features.
Fitting estimator with 210 features.
Fitting estimator with 205 features.
Fitting estimator with 200 features.
Fitting estimator with 195 features.
Fitting estimator with 190 features.
Fitting estimator with 185 features.
Fitting estimator with 180 features.
Fitting estimator with 175 features.
Fitting estimator with 170 features.
Fitting estimator with 165 features.
Fitting estimator with 160 features.
Fitting estimator with 155 features.
Fitting estimator with 150 features.
Fitting estimator with 145 features.
Fitting estimator with 140 features.
Fitting estimator with 135 features.
Fitting estimator with 130 features.
Fitting estimator with 125 features.
Fitting estimator with 120 features.
Fitting estimator with 115 features.
Fitting estimator with 110 features.
Fitting estimator with 105 features.
Fitting estimator with 100 features.
Fitting estimator with 95 features.
Fitting estimator with 90 features.
Fitting estimator with 85 features.
Fitting estimator with 80 features.
Fitting estimator with 75 features.
Fitting estimator with 70 features.
Fitting estimator with 65 features.
Fitting estimator with 60 features.
Fitting estimator with 55 features.
Fitting estimator with 50 features.
Fitting estimator with 45 features.
Fitting estimator with 40 features.
Fitting estimator with 35 features.
Fitting estimator with 30 features.
Fitting estimator with 25 features.
Fitting estimator with 20 features.
Fitting estimator with 15 features.
Fitting estimator with 10 features.
Fitting estimator with 5 features.
Fitting estimator with 880 features.
Fitting estimator with 875 features.
Fitting estimator with 870 features.
Fitting estimator with 865 features.
Fitting estimator with 860 features.
Fitting estimator with 855 features.
Fitting estimator with 850 features.
Fitting estimator with 845 features.
Fitting estimator with 840 features.
Fitting estimator with 835 features.
Fitting estimator with 830 features.
Fitting estimator with 825 features.
Fitting estimator with 820 features.
Fitting estimator with 815 features.
Fitting estimator with 810 features.
Fitting estimator with 805 features.
Fitting estimator with 800 features.
Fitting estimator with 795 features.
Fitting estimator with 790 features.
Fitting estimator with 785 features.
Fitting estimator with 780 features.
Fitting estimator with 775 features.
Fitting estimator with 770 features.
Fitting estimator with 765 features.
Fitting estimator with 760 features.
Fitting estimator with 755 features.
Fitting estimator with 750 features.
Fitting estimator with 745 features.
Fitting estimator with 740 features.
Fitting estimator with 735 features.
Fitting estimator with 730 features.
Fitting estimator with 725 features.
Fitting estimator with 720 features.
Fitting estimator with 715 features.
Fitting estimator with 710 features.
Fitting estimator with 705 features.
Fitting estimator with 700 features.
Fitting estimator with 695 features.
Fitting estimator with 690 features.
Fitting estimator with 685 features.
Fitting estimator with 680 features.
Fitting estimator with 675 features.
Fitting estimator with 670 features.
Fitting estimator with 665 features.
Fitting estimator with 660 features.
Fitting estimator with 655 features.
Fitting estimator with 650 features.
Fitting estimator with 645 features.
Fitting estimator with 640 features.
Fitting estimator with 635 features.
Fitting estimator with 630 features.
Fitting estimator with 625 features.
Fitting estimator with 620 features.
Fitting estimator with 615 features.
Fitting estimator with 610 features.
Fitting estimator with 605 features.
Fitting estimator with 600 features.
Fitting estimator with 595 features.
Fitting estimator with 590 features.
Fitting estimator with 585 features.
Fitting estimator with 580 features.
Fitting estimator with 575 features.
Fitting estimator with 570 features.
Fitting estimator with 565 features.
Fitting estimator with 560 features.
Fitting estimator with 555 features.
Fitting estimator with 550 features.
Fitting estimator with 545 features.
Fitting estimator with 540 features.
Fitting estimator with 535 features.
Fitting estimator with 530 features.
Fitting estimator with 525 features.
Fitting estimator with 520 features.
Fitting estimator with 515 features.
Fitting estimator with 510 features.
Fitting estimator with 505 features.
Fitting estimator with 500 features.
Fitting estimator with 495 features.
Fitting estimator with 490 features.
Fitting estimator with 485 features.
Fitting estimator with 480 features.
Fitting estimator with 475 features.
Fitting estimator with 470 features.
Fitting estimator with 465 features.
Fitting estimator with 460 features.
Fitting estimator with 455 features.
Fitting estimator with 450 features.
Fitting estimator with 445 features.
Fitting estimator with 440 features.
Fitting estimator with 435 features.
Fitting estimator with 430 features.
Fitting estimator with 425 features.
Fitting estimator with 420 features.
Fitting estimator with 415 features.
Fitting estimator with 410 features.
Fitting estimator with 405 features.
Fitting estimator with 400 features.
Fitting estimator with 395 features.
Fitting estimator with 390 features.
Fitting estimator with 385 features.
Fitting estimator with 380 features.
Fitting estimator with 375 features.
Fitting estimator with 370 features.
Fitting estimator with 365 features.
Fitting estimator with 360 features.
Fitting estimator with 355 features.
Fitting estimator with 350 features.
Fitting estimator with 345 features.
Fitting estimator with 340 features.
Fitting estimator with 335 features.
Fitting estimator with 330 features.
Fitting estimator with 325 features.
Fitting estimator with 320 features.
Fitting estimator with 315 features.
Fitting estimator with 310 features.
Fitting estimator with 305 features.
Fitting estimator with 300 features.
Fitting estimator with 295 features.
Fitting estimator with 290 features.
Fitting estimator with 285 features.
Fitting estimator with 280 features.
Fitting estimator with 275 features.
Fitting estimator with 270 features.
Fitting estimator with 265 features.
Fitting estimator with 260 features.
Fitting estimator with 255 features.
Fitting estimator with 250 features.
Fitting estimator with 245 features.
Fitting estimator with 240 features.
Fitting estimator with 235 features.
Fitting estimator with 230 features.
Fitting estimator with 225 features.
Fitting estimator with 220 features.
Fitting estimator with 215 features.
Fitting estimator with 210 features.
Fitting estimator with 205 features.
Fitting estimator with 200 features.
Fitting estimator with 195 features.
Fitting estimator with 190 features.
Fitting estimator with 185 features.
Fitting estimator with 180 features.
Fitting estimator with 175 features.
Fitting estimator with 170 features.
Fitting estimator with 165 features.
Fitting estimator with 160 features.
Fitting estimator with 155 features.
Fitting estimator with 150 features.
Fitting estimator with 145 features.
Fitting estimator with 140 features.
Fitting estimator with 135 features.
Fitting estimator with 130 features.
Fitting estimator with 125 features.
Fitting estimator with 120 features.
Fitting estimator with 115 features.
Fitting estimator with 110 features.
Fitting estimator with 105 features.
Fitting estimator with 100 features.
Fitting estimator with 95 features.
Fitting estimator with 90 features.
Fitting estimator with 85 features.
Fitting estimator with 80 features.
Fitting estimator with 75 features.
Fitting estimator with 70 features.
Fitting estimator with 65 features.
Fitting estimator with 60 features.
Fitting estimator with 55 features.
Fitting estimator with 50 features.
Fitting estimator with 45 features.
Fitting estimator with 40 features.
Fitting estimator with 35 features.
Fitting estimator with 30 features.
Fitting estimator with 25 features.
Fitting estimator with 20 features.
Fitting estimator with 15 features.
Fitting estimator with 10 features.
Fitting estimator with 5 features.
Fitting estimator with 880 features.
Fitting estimator with 875 features.
Fitting estimator with 870 features.
Fitting estimator with 865 features.
Fitting estimator with 860 features.
Fitting estimator with 855 features.
Fitting estimator with 850 features.
Fitting estimator with 845 features.
Fitting estimator with 840 features.
Fitting estimator with 835 features.
Fitting estimator with 830 features.
Fitting estimator with 825 features.
Fitting estimator with 820 features.
Fitting estimator with 815 features.
Fitting estimator with 810 features.
Fitting estimator with 805 features.
Fitting estimator with 800 features.
Fitting estimator with 795 features.
Fitting estimator with 790 features.
Fitting estimator with 785 features.
Fitting estimator with 780 features.
Fitting estimator with 775 features.
Fitting estimator with 770 features.
Fitting estimator with 765 features.
Fitting estimator with 760 features.
Fitting estimator with 755 features.
Fitting estimator with 750 features.
Fitting estimator with 745 features.
Fitting estimator with 740 features.
Fitting estimator with 735 features.
Fitting estimator with 730 features.
Fitting estimator with 725 features.
Fitting estimator with 720 features.
Fitting estimator with 715 features.
Fitting estimator with 710 features.
Fitting estimator with 705 features.
Fitting estimator with 700 features.
Fitting estimator with 695 features.
Fitting estimator with 690 features.
Fitting estimator with 685 features.
Fitting estimator with 680 features.
Fitting estimator with 675 features.
Fitting estimator with 670 features.
Fitting estimator with 665 features.
Fitting estimator with 660 features.
Fitting estimator with 655 features.
Fitting estimator with 650 features.
Fitting estimator with 645 features.
Fitting estimator with 640 features.
Fitting estimator with 635 features.
Fitting estimator with 630 features.
Fitting estimator with 625 features.
Fitting estimator with 620 features.
Fitting estimator with 615 features.
Fitting estimator with 610 features.
Fitting estimator with 605 features.
Fitting estimator with 600 features.
Fitting estimator with 595 features.
Fitting estimator with 590 features.
Fitting estimator with 585 features.
Fitting estimator with 580 features.
Fitting estimator with 575 features.
Fitting estimator with 570 features.
Fitting estimator with 565 features.
Fitting estimator with 560 features.
Fitting estimator with 555 features.
Fitting estimator with 550 features.
Fitting estimator with 545 features.
Fitting estimator with 540 features.
Fitting estimator with 535 features.
Fitting estimator with 530 features.
Fitting estimator with 525 features.
Fitting estimator with 520 features.
Fitting estimator with 515 features.
Fitting estimator with 510 features.
Fitting estimator with 505 features.
Fitting estimator with 500 features.
Fitting estimator with 495 features.
Fitting estimator with 490 features.
Fitting estimator with 485 features.
Fitting estimator with 480 features.
Fitting estimator with 475 features.
Fitting estimator with 470 features.
Fitting estimator with 465 features.
Fitting estimator with 460 features.
Fitting estimator with 455 features.
Fitting estimator with 450 features.
Fitting estimator with 445 features.
Fitting estimator with 440 features.
Fitting estimator with 435 features.
Fitting estimator with 430 features.
Fitting estimator with 425 features.
Fitting estimator with 420 features.
Fitting estimator with 415 features.
Fitting estimator with 410 features.
Fitting estimator with 405 features.
Fitting estimator with 400 features.
Fitting estimator with 395 features.
Fitting estimator with 390 features.
Fitting estimator with 385 features.
Fitting estimator with 380 features.
Fitting estimator with 375 features.
Fitting estimator with 370 features.
Fitting estimator with 365 features.
Fitting estimator with 360 features.
Fitting estimator with 355 features.
Fitting estimator with 350 features.
Fitting estimator with 345 features.
Fitting estimator with 340 features.
Fitting estimator with 335 features.
Fitting estimator with 330 features.
Fitting estimator with 325 features.
Fitting estimator with 320 features.
Fitting estimator with 315 features.
Fitting estimator with 310 features.
Fitting estimator with 305 features.
Fitting estimator with 300 features.
Fitting estimator with 295 features.
Fitting estimator with 290 features.
Fitting estimator with 285 features.
Fitting estimator with 280 features.
Fitting estimator with 275 features.
Fitting estimator with 270 features.
Fitting estimator with 265 features.
Fitting estimator with 260 features.
Fitting estimator with 255 features.
Fitting estimator with 250 features.
Fitting estimator with 245 features.
Fitting estimator with 240 features.
Fitting estimator with 235 features.
Fitting estimator with 230 features.
Fitting estimator with 225 features.
Fitting estimator with 220 features.
Fitting estimator with 215 features.
Fitting estimator with 210 features.
Fitting estimator with 205 features.
Fitting estimator with 200 features.
Fitting estimator with 195 features.
Fitting estimator with 190 features.
Fitting estimator with 185 features.
Fitting estimator with 180 features.
Fitting estimator with 175 features.
Fitting estimator with 170 features.
Fitting estimator with 165 features.
Fitting estimator with 160 features.
Fitting estimator with 155 features.
Fitting estimator with 150 features.
Fitting estimator with 145 features.
Fitting estimator with 140 features.
Fitting estimator with 135 features.
Fitting estimator with 130 features.
Fitting estimator with 125 features.
Fitting estimator with 120 features.
Fitting estimator with 115 features.
Fitting estimator with 110 features.
Fitting estimator with 105 features.
Fitting estimator with 100 features.
Fitting estimator with 95 features.
Fitting estimator with 90 features.
Fitting estimator with 85 features.
Fitting estimator with 80 features.
Fitting estimator with 75 features.
Fitting estimator with 70 features.
Fitting estimator with 65 features.
Fitting estimator with 60 features.
Fitting estimator with 55 features.
Fitting estimator with 50 features.
Fitting estimator with 45 features.
Fitting estimator with 40 features.
Fitting estimator with 35 features.
Fitting estimator with 30 features.
Fitting estimator with 25 features.
Fitting estimator with 20 features.
Fitting estimator with 15 features.
Fitting estimator with 10 features.
Fitting estimator with 5 features.
RFECV(cv=TimeSeriesSplit(gap=0, max_train_size=None, n_splits=3, test_size=None),
      estimator=XGBRegressor(base_score=None, booster=None, callbacks=None,
                             colsample_bylevel=None, colsample_bynode=None,
                             colsample_bytree=None, device='cuda',
                             early_stopping_rounds=None,
                             enable_categorical=False, eval_metric=None,
                             feature_types=None, gamma=None, grow_policy=None,
                             importan...teraction_constraints=None,
                             learning_rate=None, max_bin=None,
                             max_cat_threshold=None, max_cat_to_onehot=None,
                             max_delta_step=None, max_depth=5, max_leaves=None,
                             min_child_weight=3, missing=nan,
                             monotone_constraints=None, multi_strategy=None,
                             n_estimators=50, n_jobs=-1, num_parallel_tree=None,
                             random_state=42, ...),
      scoring='neg_mean_squared_error', step=5, verbose=1)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
# Save the model
joblib.dump(selector_xgb, 'selector_xgb.joblib')
['selector_xgb.joblib']
plot_n_feature_val_loss(selector_xgb, step=step_xgb, model_name='XGBoost', mark='x')

selector_result(selector_xgb, X_train, y_train, X_test, y_test, 'XGBoost')
Optimal number of features for XGBoost: 1
Selected features for Linear XGBoost: Index(['ROC_20_day-1'], dtype='object')
Best Validation MSE: 0.00012259275374271517
-----------------------------
Best XGBoost Model Train MSE: 0.00010600596254067053
Best XGBoost Model Test MSE: 5.943372552324083e-05
Best XGBoost Model Train RMSE: 0.010295919703487907
Best XGBoost Model Test RMSE: 0.007709327177078479
(0.00010600596254067053,
 5.943372552324083e-05,
 0.010295919703487907,
 0.007709327177078479)

3.3.2 Hyperparameter Optimization

from sklearn.model_selection import GridSearchCV, TimeSeriesSplit

# Time Series Cross-Validation
tscv = TimeSeriesSplit(n_splits=3)

# Initialize GridSearchCV
param_grid_xgb = {
    'n_estimators': [50, 100],  # Number of trees
    'max_depth': [3, 5, 7],  # Maximum tree depth
    'subsample': [0.8, 1.0],  # Fraction of samples per tree
    'colsample_bytree': [0.6, 1.0],  # Fraction of features per tree
    'gamma': [0, 0.1, 0.2],  # Minimum loss reduction for a split
    'min_child_weight': [3, 5],  # Minimum sum of instance weights
}
grid_search_xgb = GridSearchCV(
    estimator=XGBRegressor(
        tree_method='hist',  # Use GPU for training
        device='cuda',  # Specify GPU device
        random_state=42,
        n_jobs=-1,  # Enable CPU parallelism (optional, if GPU is not available)
    ),
    param_grid=param_grid_xgb,
    cv=tscv,  # Time series split
    scoring='neg_mean_squared_error',  # Negative MSE for scoring
    verbose=2,  # Print progress
    n_jobs=-1,  # Use all CPU cores
)

# Fit the model
grid_search_xgb.fit(X_train, y_train)
Fitting 3 folds for each of 144 candidates, totalling 432 fits
c:\ProgramData\anaconda3\Lib\site-packages\joblib\externals\loky\process_executor.py:700: UserWarning: A worker stopped while some jobs were given to the executor. This can be caused by a too short worker timeout or by a memory leak.
  warnings.warn(
GridSearchCV(cv=TimeSeriesSplit(gap=0, max_train_size=None, n_splits=3, test_size=None),
             estimator=XGBRegressor(base_score=None, booster=None,
                                    callbacks=None, colsample_bylevel=None,
                                    colsample_bynode=None,
                                    colsample_bytree=None, device='cuda',
                                    early_stopping_rounds=None,
                                    enable_categorical=False, eval_metric=None,
                                    feature_types=None, gamma=None,
                                    grow_policy=None, i...
                                    min_child_weight=None, missing=nan,
                                    monotone_constraints=None,
                                    multi_strategy=None, n_estimators=None,
                                    n_jobs=-1, num_parallel_tree=None,
                                    random_state=42, ...),
             n_jobs=-1,
             param_grid={'colsample_bytree': [0.6, 1.0], 'gamma': [0, 0.1, 0.2],
                         'max_depth': [3, 5, 7], 'min_child_weight': [3, 5],
                         'n_estimators': [50, 100], 'subsample': [0.8, 1.0]},
             scoring='neg_mean_squared_error', verbose=2)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.
# Evaluate the final model
best_model_xgb_final = grid_search_xgb.best_estimator_
best_model_xgb_final.fit(X_train[X.columns[selector_xgb.support_]], y_train)

# Save the model
joblib.dump(best_model_xgb_final, 'best_model_xgb_final.joblib')
['best_model_xgb_final.joblib']
_ = grid_search_result(grid_search_xgb, selector_xgb, best_model_xgb_final, 'XGBoost')
XGBoost Best hyperparameters: {'colsample_bytree': 0.6, 'gamma': 0.1, 'max_depth': 3, 'min_child_weight': 3, 'n_estimators': 100, 'subsample': 0.8}
XGBoost Best Validation MSE: 0.00010268245284882257
-----------------------------
XGBoost Best Model Train MSE: 0.00012705996490768268
XGBoost Best Model Test MSE: 5.086330269091728e-05
XGBoost Best Model Train RMSE: 0.011272087868167222
XGBoost Best Model Test RMSE: 0.00713185128076275

4. Neural Network Models for Regression

Because of the limited computing resource, we didn’t implement feature or hyperparameter optimization for Neural Network models. These models are just exploratory attempts.

4.1 Multilayer Perceptron

MLP_reg = Sequential([
    Dense(512, activation='relu', input_shape=(X_train.shape[1],)),  # Input layer
    Dense(128, activation='relu'),  # Hidden layer
    Dense(1)  # Output layer (linear activation)
])

# Compile the model
MLP_reg.compile(optimizer=Adam(learning_rate=0.01), loss='mse')

split_date = int(0.75 * len(X_train))  # 60% training (0.75*80%), 20% validation
X_train_split, X_val = X_train[:split_date], X_train[split_date:]
y_train_split, y_val = y_train[:split_date], y_train[split_date:]

early_stopping = EarlyStopping(
    monitor='val_loss', 
    patience=20, 
    restore_best_weights=True
)
reduce_lr = ReduceLROnPlateau(
    monitor='val_loss',
    factor=0.1,
    patience=5,
    min_lr=1e-6,
    verbose=0,
)

callbacks = [
    early_stopping,
    reduce_lr,
]

# Train the model
history = MLP_reg.fit(
    X_train_split,
    y_train_split,
    epochs=100,
    batch_size=32,
    validation_data=(X_val, y_val),
    callbacks=callbacks,
)
C:\Users\zln92\AppData\Roaming\Python\Python311\site-packages\keras\src\layers\core\dense.py:87: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
Epoch 1/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 2s 12ms/step - loss: 48.4190 - val_loss: 0.0687 - learning_rate: 0.0100

Epoch 2/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 0.0013 - val_loss: 0.0241 - learning_rate: 0.0100

Epoch 3/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0010 - val_loss: 0.0222 - learning_rate: 0.0100

Epoch 4/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 7.7949e-04 - val_loss: 0.0210 - learning_rate: 0.0100

Epoch 5/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 5.6575e-04 - val_loss: 0.0201 - learning_rate: 0.0100

Epoch 6/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 4.1016e-04 - val_loss: 0.0195 - learning_rate: 0.0100

Epoch 7/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 2.6531e-04 - val_loss: 0.0188 - learning_rate: 0.0100

Epoch 8/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 2.0890e-04 - val_loss: 0.0184 - learning_rate: 0.0100

Epoch 9/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.7962e-04 - val_loss: 0.0179 - learning_rate: 0.0100

Epoch 10/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.4781e-04 - val_loss: 0.0176 - learning_rate: 0.0100

Epoch 11/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2998e-04 - val_loss: 0.0174 - learning_rate: 0.0100

Epoch 12/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3270e-04 - val_loss: 0.0173 - learning_rate: 0.0100

Epoch 13/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3352e-04 - val_loss: 0.0172 - learning_rate: 0.0100

Epoch 14/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3359e-04 - val_loss: 0.0171 - learning_rate: 0.0100

Epoch 15/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3150e-04 - val_loss: 0.0171 - learning_rate: 0.0100

Epoch 16/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3089e-04 - val_loss: 0.0171 - learning_rate: 0.0100

Epoch 17/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2469e-04 - val_loss: 0.0171 - learning_rate: 0.0100

Epoch 18/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3430e-04 - val_loss: 0.0170 - learning_rate: 0.0100

Epoch 19/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2950e-04 - val_loss: 0.0170 - learning_rate: 0.0100

Epoch 20/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2746e-04 - val_loss: 0.0170 - learning_rate: 0.0100

Epoch 21/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2412e-04 - val_loss: 0.0170 - learning_rate: 0.0100

Epoch 22/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.4509e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-03

Epoch 23/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3784e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-03

Epoch 24/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3388e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-03

Epoch 25/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3646e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-03

Epoch 26/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.2867e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-03

Epoch 27/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.4292e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-04

Epoch 28/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.2472e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-04

Epoch 29/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2470e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-04

Epoch 30/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2030e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-04

Epoch 31/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.4047e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-04

Epoch 32/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.4166e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-05

Epoch 33/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3643e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-05

Epoch 34/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2316e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-05

Epoch 35/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2334e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-05

Epoch 36/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3595e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-05

Epoch 37/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.4116e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-06

Epoch 38/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3190e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-06

Epoch 39/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3455e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-06

Epoch 40/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3248e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-06

Epoch 41/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3989e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-06

Epoch 42/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3399e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-06

Epoch 43/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.2894e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-06

Epoch 44/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3307e-04 - val_loss: 0.0170 - learning_rate: 1.0000e-06
MLP_reg.save('MLP_reg.keras')
plt.title('Training and Validation Loss of MLP for Regression')
plt.plot(history.history['loss'], label='Training Loss')
plt.plot(history.history['val_loss'], label='Validation Loss')
plt.xlabel('Epoch')
plt.ylabel('Loss')
plt.yscale('log')
plt.legend()
plt.show()

# Evaluate the model
def result_nn(model, model_name='', X_tr=X_train, y_tr=y_train, X_te=X_test, y_te=y_test, print_out=True, predict=False):
    train_MSE = model.evaluate(X_tr, y_tr)
    test_MSE = model.evaluate(X_te, y_te)
    train_RMSE = np.sqrt(train_MSE)
    test_RMSE = np.sqrt(test_MSE)
    y_test_predict = model.predict(X_te)
    if print_out:
        print(f'{model_name} Train MSE: {train_MSE}')
        print(f'{model_name} Test MSE: {test_MSE}')
        print(f'{model_name} Train RMSE: {train_RMSE}')
        print(f'{model_name} Test RMSE: {test_RMSE}')

    if not predict:
        return train_MSE, test_MSE, train_RMSE, test_RMSE
    else:
        return list(y_test_predict)


_ = result_nn(MLP_reg, 'MLP (Regression)')
49/49 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - loss: 8.8159e-04 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 0.0018 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step 

MLP (Regression) Train MSE: 0.00435810349881649

MLP (Regression) Test MSE: 0.001041724462993443

MLP (Regression) Train RMSE: 0.06601593367374645

MLP (Regression) Test RMSE: 0.03227575658281991

4.2 Long Short Term Memory (LSTM) Network

4.2.1 Additional data transformation

We need to modify the data shape to fit into the LSTM network.

# Choose the target variable
target_col = 'Close_ROC'

df_nn = df_raw.drop(columns=['Date', 'Name'], errors='ignore')
df_nn = df_nn.dropna()

# Scale all features using StandardScaler
scaler = StandardScaler()
scaled_data = scaler.fit_transform(df_nn)

# We use the previous 5 days data to predict
sequence_length = 5
# Create sequences (X) and target (y)
X_nn, y_nn = [], []
for i in range(len(df_nn) - sequence_length):
    X_nn.append(df_nn.iloc[i:i+sequence_length].values)
    y_nn.append(df_nn[target_col].iloc[i+sequence_length])

# Convert to numpy arrays
X_nn = np.array(X_nn)
y_nn = np.array(y_nn)

# For example, split the data into training (60%), validation (20%), and test (20%) sets
train_size = int(0.60 * len(X_nn))
val_size = int(0.20 * len(X_nn))
test_split = int(0.80 * len(X_nn))

X_train_nn, y_train_nn = X_nn[:train_size], y_nn[:train_size]
X_val_nn, y_val_nn = X_nn[train_size:train_size+val_size], y_nn[train_size:train_size+val_size]
X_test_nn, y_test_nn = X_nn[test_split:], y_nn[test_split:]

print("X_train shape:", X_train_nn.shape)  # (num_train_samples, window_size, num_features)
print("y_train shape:", y_train_nn.shape)
X_train shape: (1157, 5, 88)
y_train shape: (1157,)

4.2.2 Training

lstm_reg = Sequential([
    LSTM(
        128,
        return_sequences=False,
        input_shape=(X_train_nn.shape[1], X_train_nn.shape[2]),
        dropout=0.5,
        recurrent_dropout=0.5,
    ),
    Dropout(0.5),
    Dense(64, activation='relu'),
    Dropout(0.5),
    Dense(1),
])

lstm_reg.compile(optimizer=Adam(learning_rate=0.001), loss='mse')

# Early stopping
early_stopping = EarlyStopping(
    monitor='val_loss',
    patience=20,
    restore_best_weights=True,
)

history = lstm_reg.fit(
    X_train_nn,
    y_train_nn,
    validation_data=(X_val_nn, y_val_nn),
    epochs=100,
    batch_size=32,
    callbacks=[early_stopping],
    verbose=1,
)

# Save the trained model
lstm_reg.save('lstm_reg.keras')
Epoch 1/100
C:\Users\zln92\AppData\Roaming\Python\Python311\site-packages\keras\src\layers\rnn\rnn.py:200: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(**kwargs)
37/37 ━━━━━━━━━━━━━━━━━━━━ 4s 17ms/step - loss: 0.6221 - val_loss: 0.0699

Epoch 2/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.3012 - val_loss: 0.0381

Epoch 3/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.2395 - val_loss: 0.0055

Epoch 4/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.1609 - val_loss: 8.2306e-04

Epoch 5/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0949 - val_loss: 1.4668e-04

Epoch 6/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0803 - val_loss: 1.2618e-04

Epoch 7/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0571 - val_loss: 1.1901e-04

Epoch 8/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0468 - val_loss: 2.3850e-04

Epoch 9/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0439 - val_loss: 2.5668e-04

Epoch 10/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0344 - val_loss: 3.3398e-04

Epoch 11/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0267 - val_loss: 3.1353e-04

Epoch 12/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0273 - val_loss: 1.1845e-04

Epoch 13/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0197 - val_loss: 1.3941e-04

Epoch 14/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0177 - val_loss: 1.5279e-04

Epoch 15/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 7ms/step - loss: 0.0172 - val_loss: 1.5038e-04

Epoch 16/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0121 - val_loss: 2.1746e-04

Epoch 17/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0108 - val_loss: 1.5716e-04

Epoch 18/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 0.0088 - val_loss: 1.7635e-04

Epoch 19/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0076 - val_loss: 1.4064e-04

Epoch 20/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0082 - val_loss: 1.6360e-04

Epoch 21/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0055 - val_loss: 1.7268e-04

Epoch 22/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0073 - val_loss: 2.0646e-04

Epoch 23/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 0.0053 - val_loss: 1.3289e-04

Epoch 24/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 0.0046 - val_loss: 1.6827e-04

Epoch 25/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0043 - val_loss: 1.6713e-04

Epoch 26/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0039 - val_loss: 1.3411e-04

Epoch 27/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0038 - val_loss: 1.5198e-04

Epoch 28/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0033 - val_loss: 1.4898e-04

Epoch 29/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0028 - val_loss: 1.1839e-04

Epoch 30/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 0.0026 - val_loss: 1.4790e-04

Epoch 31/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0022 - val_loss: 1.3562e-04

Epoch 32/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0024 - val_loss: 1.3838e-04

Epoch 33/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0021 - val_loss: 1.2952e-04

Epoch 34/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0019 - val_loss: 1.2973e-04

Epoch 35/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0019 - val_loss: 1.3039e-04

Epoch 36/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0015 - val_loss: 1.1754e-04

Epoch 37/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0019 - val_loss: 1.1735e-04

Epoch 38/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0017 - val_loss: 1.1970e-04

Epoch 39/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0016 - val_loss: 1.2148e-04

Epoch 40/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 7ms/step - loss: 0.0012 - val_loss: 1.2273e-04

Epoch 41/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0013 - val_loss: 1.2091e-04

Epoch 42/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 0.0014 - val_loss: 1.2954e-04

Epoch 43/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0012 - val_loss: 1.2313e-04

Epoch 44/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 9.2076e-04 - val_loss: 1.1762e-04

Epoch 45/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 9.8157e-04 - val_loss: 1.2080e-04

Epoch 46/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 7.5778e-04 - val_loss: 1.2152e-04

Epoch 47/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 8.6865e-04 - val_loss: 1.2130e-04

Epoch 48/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 8.2736e-04 - val_loss: 1.1941e-04

Epoch 49/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 8.1362e-04 - val_loss: 1.2545e-04

Epoch 50/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 8.3782e-04 - val_loss: 1.1824e-04

Epoch 51/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 9.2354e-04 - val_loss: 1.1838e-04

Epoch 52/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 5.8213e-04 - val_loss: 1.1737e-04

Epoch 53/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 5.9316e-04 - val_loss: 1.1770e-04

Epoch 54/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 7.9941e-04 - val_loss: 1.1710e-04

Epoch 55/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 5.0735e-04 - val_loss: 1.1709e-04

Epoch 56/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 5.3108e-04 - val_loss: 1.1969e-04

Epoch 57/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 6.1958e-04 - val_loss: 1.1820e-04

Epoch 58/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 7.5449e-04 - val_loss: 1.1930e-04

Epoch 59/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 5.4645e-04 - val_loss: 1.2019e-04

Epoch 60/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 4.7346e-04 - val_loss: 1.1966e-04

Epoch 61/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 3.9326e-04 - val_loss: 1.1716e-04

Epoch 62/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 5.5395e-04 - val_loss: 1.2005e-04

Epoch 63/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 6.4767e-04 - val_loss: 1.1854e-04

Epoch 64/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 4.5624e-04 - val_loss: 1.1788e-04

Epoch 65/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 4.4687e-04 - val_loss: 1.1709e-04

Epoch 66/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.9228e-04 - val_loss: 1.1749e-04

Epoch 67/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 3.8819e-04 - val_loss: 1.1715e-04

Epoch 68/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.5908e-04 - val_loss: 1.1854e-04

Epoch 69/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.3763e-04 - val_loss: 1.1755e-04

Epoch 70/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 3.7734e-04 - val_loss: 1.1709e-04

Epoch 71/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.5650e-04 - val_loss: 1.1760e-04

Epoch 72/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.1977e-04 - val_loss: 1.1709e-04

Epoch 73/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 3.7925e-04 - val_loss: 1.1741e-04

Epoch 74/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.5705e-04 - val_loss: 1.1708e-04

Epoch 75/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.0423e-04 - val_loss: 1.1726e-04

Epoch 76/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 4.2551e-04 - val_loss: 1.1716e-04

Epoch 77/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.1666e-04 - val_loss: 1.1729e-04

Epoch 78/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.1278e-04 - val_loss: 1.1805e-04

Epoch 79/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.0009e-04 - val_loss: 1.1710e-04

Epoch 80/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.4286e-04 - val_loss: 1.2090e-04

Epoch 81/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.4950e-04 - val_loss: 1.1722e-04

Epoch 82/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.5682e-04 - val_loss: 1.1727e-04

Epoch 83/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.3842e-04 - val_loss: 1.1708e-04

Epoch 84/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 3.6073e-04 - val_loss: 1.1724e-04

Epoch 85/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.4341e-04 - val_loss: 1.1784e-04

Epoch 86/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.2171e-04 - val_loss: 1.1711e-04

Epoch 87/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.0149e-04 - val_loss: 1.1723e-04

Epoch 88/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.8024e-04 - val_loss: 1.1805e-04

Epoch 89/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.2784e-04 - val_loss: 1.1708e-04

Epoch 90/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.3941e-04 - val_loss: 1.1712e-04

Epoch 91/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.8911e-04 - val_loss: 1.1848e-04

Epoch 92/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.5088e-04 - val_loss: 1.1739e-04

Epoch 93/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 2.2310e-04 - val_loss: 1.1789e-04

Epoch 94/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.8202e-04 - val_loss: 1.1739e-04

Epoch 95/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 2.1815e-04 - val_loss: 1.1801e-04

Epoch 96/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 1.9053e-04 - val_loss: 1.1784e-04

Epoch 97/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 7ms/step - loss: 2.1361e-04 - val_loss: 1.1913e-04

Epoch 98/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 2.0350e-04 - val_loss: 1.1918e-04

Epoch 99/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 2.1561e-04 - val_loss: 1.2011e-04

Epoch 100/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 1.8266e-04 - val_loss: 1.1839e-04
plt.title('Training and Validation Loss of LSTM for Regression')
plt.plot(history.history['loss'], label='Training Loss')
plt.plot(history.history['val_loss'], label='Validation Loss')
plt.xlabel('Epoch')
plt.ylabel('Loss')
plt.yscale('log')
plt.legend()
plt.show()

_ = result_nn(
    lstm_reg,
    'LSTM (Regression)',
    X_tr=X_train_nn,
    y_tr=y_train_nn,
    X_te=X_test_nn,
    y_te=y_test_nn,
)
37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 1.6815e-04

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 6.2900e-05 

13/13 ━━━━━━━━━━━━━━━━━━━━ 1s 53ms/step

LSTM (Regression) Train MSE: 0.0001305853365920484

LSTM (Regression) Test MSE: 5.119918205309659e-05

LSTM (Regression) Train RMSE: 0.01142739412954889

LSTM (Regression) Test RMSE: 0.007155360371993614

4.3 Convolutional Neural Network (CNN)

num_features = X_train_nn.shape[2]  # number of columns in original dataset

CNN1D_reg = Sequential([
    Conv1D(
        filters=64,
        kernel_size=5,
        activation='relu',
        padding='same',
        input_shape=(sequence_length, num_features),
    ),
    MaxPooling1D(pool_size=2),
    Conv1D(
        filters=32,
        kernel_size=5,
        activation='relu',
        padding='same',
    ),
    MaxPooling1D(pool_size=2),
    Flatten(),
    Dense(50, activation='relu'),
    Dense(1),
])

CNN1D_reg.compile(optimizer=Adam(learning_rate=0.1), loss='mse')

# Early stopping
early_stopping = EarlyStopping(
    monitor='val_loss',
    patience=20,
    restore_best_weights=True,
)

history = CNN1D_reg.fit(
    X_train_nn,
    y_train_nn,
    validation_data=(X_val_nn, y_val_nn),
    epochs=100,
    batch_size=32,
    callbacks=[early_stopping, reduce_lr],
    verbose=1,
)

CNN1D_reg.save('CNN1D_reg.keras')
Epoch 1/100
C:\Users\zln92\AppData\Roaming\Python\Python311\site-packages\keras\src\layers\convolutional\base_conv.py:107: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super().__init__(activity_regularizer=activity_regularizer, **kwargs)
37/37 ━━━━━━━━━━━━━━━━━━━━ 3s 9ms/step - loss: 1447449344.0000 - val_loss: 6036.1299 - learning_rate: 0.1000

Epoch 2/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 819.7986 - val_loss: 72.9835 - learning_rate: 0.1000

Epoch 3/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 11.2172 - val_loss: 0.7078 - learning_rate: 0.1000

Epoch 4/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.1930 - val_loss: 0.4386 - learning_rate: 0.1000

Epoch 5/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0319 - val_loss: 0.1091 - learning_rate: 0.1000

Epoch 6/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 0.0172 - val_loss: 0.0432 - learning_rate: 0.1000

Epoch 7/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0208 - val_loss: 0.2549 - learning_rate: 0.1000

Epoch 8/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0197 - val_loss: 0.0231 - learning_rate: 0.1000

Epoch 9/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 0.0278 - val_loss: 0.0348 - learning_rate: 0.1000

Epoch 10/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0258 - val_loss: 0.2173 - learning_rate: 0.1000

Epoch 11/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0241 - val_loss: 0.3775 - learning_rate: 0.1000

Epoch 12/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0492 - val_loss: 0.6089 - learning_rate: 0.1000

Epoch 13/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0616 - val_loss: 0.4884 - learning_rate: 0.1000

Epoch 14/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0375 - val_loss: 0.0468 - learning_rate: 0.0100

Epoch 15/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0174 - val_loss: 0.0760 - learning_rate: 0.0100

Epoch 16/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0150 - val_loss: 0.0345 - learning_rate: 0.0100

Epoch 17/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0159 - val_loss: 0.0963 - learning_rate: 0.0100

Epoch 18/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0129 - val_loss: 0.0694 - learning_rate: 0.0100

Epoch 19/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0125 - val_loss: 0.0744 - learning_rate: 1.0000e-03

Epoch 20/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 0.0126 - val_loss: 0.0772 - learning_rate: 1.0000e-03

Epoch 21/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 0.0134 - val_loss: 0.0679 - learning_rate: 1.0000e-03

Epoch 22/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0129 - val_loss: 0.0854 - learning_rate: 1.0000e-03

Epoch 23/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0139 - val_loss: 0.0701 - learning_rate: 1.0000e-03

Epoch 24/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0131 - val_loss: 0.0674 - learning_rate: 1.0000e-04

Epoch 25/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0131 - val_loss: 0.0684 - learning_rate: 1.0000e-04

Epoch 26/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0128 - val_loss: 0.0665 - learning_rate: 1.0000e-04

Epoch 27/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 0.0132 - val_loss: 0.0673 - learning_rate: 1.0000e-04

Epoch 28/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 0.0130 - val_loss: 0.0680 - learning_rate: 1.0000e-04
plt.title('Training and Validation Loss of 1D CNN for Regression')
plt.plot(history.history['loss'], label='Training Loss')
plt.plot(history.history['val_loss'], label='Validation Loss')
plt.xlabel('Epoch')
plt.ylabel('Loss')
plt.yscale('log')
plt.legend()
plt.show()

_ = result_nn(
    CNN1D_reg,
    '1D CNN (Regression)',
    X_tr=X_train_nn,
    y_tr=y_train_nn,
    X_te=X_test_nn,
    y_te=y_test_nn,
)
37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 0.0319 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 0.0471 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 8ms/step

1D CNN (Regression) Train MSE: 0.01970905438065529

1D CNN (Regression) Test MSE: 0.07369030267000198

1D CNN (Regression) Train RMSE: 0.14038893966639712

1D CNN (Regression) Test RMSE: 0.27145957833534257

4.4 CNN LSTM

CNN1D_lstm_reg = Sequential([
    Conv1D(
        filters=64,
        kernel_size=5,
        activation='relu',
        padding='same',
        input_shape=(sequence_length, num_features),
    ),
    MaxPooling1D(pool_size=2),
    Conv1D(
        filters=32,
        kernel_size=5,
        activation='relu',
        padding='same',
    ),
    MaxPooling1D(pool_size=2),
    LSTM(32, return_sequences=False),
    Dense(50, activation='relu'),
    Dense(1),
])

CNN1D_lstm_reg.compile(optimizer=Adam(learning_rate=0.1), loss='mse')

# Early stopping
early_stopping = EarlyStopping(
    monitor='val_loss',
    patience=20,
    restore_best_weights=True,
)

history = CNN1D_lstm_reg.fit(
    X_train_nn,
    y_train_nn,
    validation_data=(X_val_nn, y_val_nn),
    epochs=100,
    batch_size=32,
    callbacks=[early_stopping, reduce_lr],
    verbose=1,
)

CNN1D_lstm_reg.save('CNN1D_lstm_reg.keras')
Epoch 1/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 3s 12ms/step - loss: 0.8922 - val_loss: 0.0024 - learning_rate: 0.1000

Epoch 2/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 0.0021 - val_loss: 1.2201e-04 - learning_rate: 0.1000

Epoch 3/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.5326e-04 - val_loss: 1.1884e-04 - learning_rate: 0.1000

Epoch 4/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.5140e-04 - val_loss: 1.2202e-04 - learning_rate: 0.1000

Epoch 5/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2620e-04 - val_loss: 1.2179e-04 - learning_rate: 0.1000

Epoch 6/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.4153e-04 - val_loss: 1.3648e-04 - learning_rate: 0.1000

Epoch 7/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.4528e-04 - val_loss: 1.1876e-04 - learning_rate: 0.1000

Epoch 8/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2227e-04 - val_loss: 1.1712e-04 - learning_rate: 0.0100

Epoch 9/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.1566e-04 - val_loss: 1.1713e-04 - learning_rate: 0.0100

Epoch 10/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.5773e-04 - val_loss: 1.1710e-04 - learning_rate: 0.0100

Epoch 11/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2773e-04 - val_loss: 1.1764e-04 - learning_rate: 0.0100

Epoch 12/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2657e-04 - val_loss: 1.1710e-04 - learning_rate: 0.0100

Epoch 13/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3492e-04 - val_loss: 1.1714e-04 - learning_rate: 1.0000e-03

Epoch 14/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2028e-04 - val_loss: 1.1716e-04 - learning_rate: 1.0000e-03

Epoch 15/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3301e-04 - val_loss: 1.1712e-04 - learning_rate: 1.0000e-03

Epoch 16/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3516e-04 - val_loss: 1.1722e-04 - learning_rate: 1.0000e-03

Epoch 17/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.4031e-04 - val_loss: 1.1730e-04 - learning_rate: 1.0000e-03

Epoch 18/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.4178e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-04

Epoch 19/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2104e-04 - val_loss: 1.1730e-04 - learning_rate: 1.0000e-04

Epoch 20/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3550e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-04

Epoch 21/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.2281e-04 - val_loss: 1.1727e-04 - learning_rate: 1.0000e-04

Epoch 22/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3376e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-04

Epoch 23/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3211e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-05

Epoch 24/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3694e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-05

Epoch 25/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.2585e-04 - val_loss: 1.1728e-04 - learning_rate: 1.0000e-05

Epoch 26/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step - loss: 1.3536e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-05

Epoch 27/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.3663e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-05

Epoch 28/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 1.2884e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-06

Epoch 29/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 1s 18ms/step - loss: 1.3420e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-06

Epoch 30/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 1.2918e-04 - val_loss: 1.1728e-04 - learning_rate: 1.0000e-06

Epoch 31/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 6ms/step - loss: 1.5119e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-06

Epoch 32/100

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 5ms/step - loss: 1.3169e-04 - val_loss: 1.1729e-04 - learning_rate: 1.0000e-06
plt.title('Training and Validation Loss of CNN LSTM for Regression')
plt.plot(history.history['loss'], label='Training Loss')
plt.plot(history.history['val_loss'], label='Validation Loss')
plt.xlabel('Epoch')
plt.ylabel('Loss')
plt.yscale('log')
plt.legend()
plt.show()

_ = result_nn(
    CNN1D_lstm_reg,
    'CNN LSTM (Regression)',
    X_tr=X_train_nn,
    y_tr=y_train_nn,
    X_te=X_test_nn,
    y_te=y_test_nn,
)
37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 1.6813e-04

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 6.2670e-05 

13/13 ━━━━━━━━━━━━━━━━━━━━ 1s 22ms/step

CNN LSTM (Regression) Train MSE: 0.00013050153211224824

CNN LSTM (Regression) Test MSE: 5.0988739531021565e-05

CNN LSTM (Regression) Train RMSE: 0.011423726717330393

CNN LSTM (Regression) Test RMSE: 0.007140639994497802

5. Model Comparison and Discussion

5.1 Comparison of RMSE

First, we compare the training and testing RMSE of the 8 models we’ve trained. We use RMSE as criterion.

# Load saved models for comparison
lin_reg_c = joblib.load('selector_lin_reg_cv.joblib')
dt_c = joblib.load('selector_dt.joblib')
rf_c = joblib.load('selector_rf.joblib')
xgb_c = joblib.load('selector_xgb.joblib')
mlp_c = load_model('MLP_reg.keras')
lstm_c = load_model('lstm_reg.keras')
cnn_c = load_model('CNN1D_reg.keras')
cnn_lstm_c = load_model('CNN1D_lstm_reg.keras')

model_list = [
    'baseline',
    lin_reg_c,
    dt_c,
    rf_c,
    xgb_c,
    mlp_c,
    lstm_c,
    cnn_c,
    cnn_lstm_c,
]

model_names = [
    'Baseline',
    'Linear Regression',
    'Decision Tree',
    'Random Forest',
    'XGBoost',
    'MLP',
    'LSTM',
    '1D CNN',
    'CNN LSTM',
]
df_model_comparison = pd.DataFrame(
    columns=[
        'model',
        'model_name',
        'train_MSE',
        'test_MSE',
        'train_RMSE',
        'test_RMSE',
        'y_test_predict',
    ]
)

df_model_comparison['model'] = model_list
df_model_comparison['model_name'] = model_names

df_model_comparison.iloc[0, 2:6] = (
    baseline_mse_train_final,
    baseline_mse_test_final,
    baseline_rmse_train_final,
    baseline_rmse_test_final,
)
df_model_comparison.iat[0, 6] = baseline_test_predict

for i in range(1, 5):
    df_model_comparison.iloc[i, 2:6] = selector_result(
        df_model_comparison.loc[i, 'model'], print_out=False
    )
    df_model_comparison.iat[i, 6] = selector_result(
        df_model_comparison.loc[i, 'model'], print_out=False, predict=True
    )

df_model_comparison.iloc[5, 2:6] = result_nn(
    df_model_comparison.loc[5, 'model'], print_out=False
)
df_model_comparison.iat[5, 6] = result_nn(
    df_model_comparison.loc[5, 'model'], print_out=False, predict=True
)

for i in range(6, 9):
    df_model_comparison.iloc[i, 2:6] = result_nn(
        df_model_comparison.loc[i, 'model'],
        model_name='',
        X_tr=X_train_nn,
        y_tr=y_train_nn,
        X_te=X_test_nn,
        y_te=y_test_nn,
        print_out=False,
    )
    df_model_comparison.iat[i, 6] = result_nn(
        df_model_comparison.loc[i, 'model'],
        model_name='',
        X_tr=X_train_nn,
        y_tr=y_train_nn,
        X_te=X_test_nn,
        y_te=y_test_nn,
        print_out=False,
        predict=True,
    )

df_model_comparison['y_test_predict'] = df_model_comparison['y_test_predict'].apply(
    lambda x: np.ravel(x)
)

df_model_comparison
49/49 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 8.8159e-04 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 0.0018 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 4ms/step 

49/49 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - loss: 8.8159e-04

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 0.0018 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step 

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 1.6815e-04  

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 6.2900e-05 

13/13 ━━━━━━━━━━━━━━━━━━━━ 1s 30ms/step

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 1.6815e-04

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 6.2900e-05 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step 

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 0.0319  

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 0.0471 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 10ms/step

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 1ms/step - loss: 0.0319 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 3ms/step - loss: 0.0471 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step 

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 1.6813e-04  

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 6.2670e-05 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 16ms/step

37/37 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 1.6813e-04 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step - loss: 6.2670e-05 

13/13 ━━━━━━━━━━━━━━━━━━━━ 0s 2ms/step 
model model_name train_MSE test_MSE train_RMSE test_RMSE y_test_predict
0 baseline Baseline 0.000127 0.000052 0.011283 0.007178 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
1 RFECV(cv=TimeSeriesSplit(gap=0, max_train_size... Linear Regression 0.000126 0.000058 0.011231 0.007611 [9.748103946616224e-05, 0.000582024958710533, ...
2 RFECV(cv=TimeSeriesSplit(gap=0, max_train_size... Decision Tree 0.000094 0.000053 0.00969 0.007294 [0.0003911573186231354, 0.0003911573186231354,...
3 RFECV(cv=TimeSeriesSplit(gap=0, max_train_size... Random Forest 0.000105 0.000054 0.010224 0.00736 [0.0019121735784212019, 0.0010096476163310333,...
4 RFECV(cv=TimeSeriesSplit(gap=0, max_train_size... XGBoost 0.000106 0.000059 0.010296 0.007709 [-0.004676743, 0.002464143, 0.0020128984, 0.00...
5 <Sequential name=sequential, built=True> MLP 0.004358 0.001042 0.066016 0.032276 [0.00056827633, 0.00056827633, 0.00056827633, ...
6 <Sequential name=sequential_1, built=True> LSTM 0.000131 0.000051 0.011427 0.007155 [0.00019381603, 0.00019381603, 0.00019381603, ...
7 <Sequential name=sequential_2, built=True> 1D CNN 0.019709 0.07369 0.140389 0.27146 [0.15607905, 0.14068294, 0.13164973, 0.1305968...
8 <Sequential name=sequential_3, built=True> CNN LSTM 0.000131 0.000051 0.011424 0.007141 [0.00035510492, 0.00035510492, 0.00035510492, ...

We didn’t find a proper method to set random states for neural network models, so you may get different results if you run the code again.

From the bar graph below, we can observe that there’s no model that is significantly better than the baseline model.

Some testing RMSE is lower than the traing RMSE. The reason might be that our testing data not obtained by randomly sampling, and the testing data is substantially different from the training data, according to our UMAP analysis in section 1.3.1.

From the table above, we can see that the predicted values some models including the neural network models are constants. They may just predict the rate of change to be the daily average rate of change. So, these model fails to grasp the increasing or decreasing trend of the Nasdaq Index.

# Melt the dataframe to have train_MSE and test_MSE in one column
df_melted = df_model_comparison.melt(
    id_vars=['model_name'],
    value_vars=['train_RMSE', 'test_RMSE'],
    var_name='RMSE_Type',
    value_name='RMSE_Value',
)

# Set the figure size
plt.figure(figsize=(12, 6))

# Plot the bars side by side using hue
ax = sns.barplot(
    x='model_name', y='RMSE_Value', hue='RMSE_Type', data=df_melted
)

# Add value labels on each bar
for p in ax.patches:
    ax.annotate(
        f'{p.get_height():.5f}',
        (p.get_x() + p.get_width() / 2., p.get_height()),
        ha='center',
        va='bottom',
        fontsize=10,
        color='black',
        rotation=0,
    )

# Add labels and title
plt.xlabel('Model')
plt.ylabel('RMSE')
plt.title('Train and Test RMSE for Each Model')
plt.xticks(rotation=0)
plt.yscale('log')
plt.legend()

# Show the plot
plt.tight_layout()
plt.show()

5.2 Predicting Nasdaq Index

# Keep only 'Close' and 'Close_day-1' columns in df_compare
df_compare = df.iloc[split_index:][['Close', 'Close_day-1']]

for i in range(9):
    model_name = df_model_comparison.loc[i, 'model_name']
    y_test_predict = df_model_comparison.loc[i, 'y_test_predict']
    df_compare[model_name] = df_compare['Close_day-1'] * (1 + y_test_predict)

df_compare
Close Close_day-1 Baseline Linear Regression Decision Tree Random Forest XGBoost MLP LSTM 1D CNN CNN LSTM
1598 4750.209961 4736.160156 4736.160156 4736.621842 4738.012740 4745.216516 4714.010275 4738.851577 4737.078186 5475.375552 4737.842082
1599 4809.879883 4750.209961 4750.209961 4752.974702 4752.068040 4755.005999 4761.915311 4752.909366 4751.130715 5418.483444 4751.896877
1600 4760.689941 4809.879883 4809.879883 4814.637871 4811.761303 4810.711296 4819.561444 4812.613197 4810.812203 5443.099283 4811.587989
1601 4737.330078 4760.689941 4760.689941 4765.626611 4762.552120 4763.370205 4807.241778 4763.395302 4761.612726 5382.421176 4762.380579
1602 4717.680176 4737.330078 4737.330078 4738.565476 4739.183119 4740.332310 4706.732521 4740.022164 4738.248335 5437.549106 4739.012420
... ... ... ... ... ... ... ... ... ... ... ...
1979 6750.049805 6789.120117 6789.120117 6763.667137 6791.775731 6785.791067 6793.182125 6792.978175 6790.436081 9504.084121 6791.531100
1980 6750.939941 6750.049805 6750.049805 6723.597959 6752.690136 6748.439763 6762.724141 6753.885660 6751.358196 9488.322709 6752.446913
1981 6757.600098 6750.939941 6750.939941 6725.801424 6753.580621 6741.231789 6756.923441 6754.776302 6752.248505 9552.616779 6753.337365
1982 6737.870117 6757.600098 6757.600098 6730.846650 6760.243383 6756.024509 6767.336201 6761.440244 6758.909953 9578.126533 6759.999887
1983 6706.209961 6737.870117 6737.870117 6712.351766 6740.505684 6726.680086 6732.851619 6741.699051 6739.176147 9479.838308 6740.262900

386 rows × 11 columns

We can see that most model follows closely to the true value, while some model substantially deviate from the true value.

test_dates = df_raw.loc[y_test.index, 'Date']

plt.figure(figsize=(12, 6))

for column in df_compare.columns:
    if column not in ['Close_day-1']:
        label = "True Nasdaq Index" if column == "Close" else column
        plt.plot(test_dates, df_compare[column], label=label)

plt.legend()
plt.xlabel("Index")
plt.ylabel("Value")
plt.title("Comparison of True Nasdaq Index and Other Models")
plt.show()

5.3 Investment Simulation

# ---------------------------------------------------------------
# Compute the true daily return using the 'Close' and 'Close_day-1' columns.
# Daily return is defined as (Close / Close_day-1) - 1.
# ---------------------------------------------------------------
df_compare['y_test'] = df_compare['Close'] / df_compare['Close_day-1'] - 1

# ---------------------------------------------------------------
# Calculate the cumulative return for the baseline (Invest & Hold) strategy.
# Invest & Hold: simply holding the asset, so cumulative return is the
# cumulative product of (1 + true daily return).
# ---------------------------------------------------------------
invest_hold_return = (1 + df_compare['y_test']).cumprod()

# ---------------------------------------------------------------
# Define a function to calculate cumulative strategy returns.
# For each day, if the predicted return (y_pred) is >= 0, we take a long
# position (+1); otherwise, a short position (-1). The strategy's daily
# return is then: position * true daily return.
# ---------------------------------------------------------------
def calc_strategy_returns(y_true, y_pred):
    # Determine position: long if predicted return >= 0, else short.
    position = np.where(y_pred >= 0, 1, -1)
    # Calculate daily strategy returns.
    daily_returns = position * y_true
    # Compute cumulative returns as the cumulative product of (1 + daily return).
    cum_returns = (1 + pd.Series(daily_returns, index=y_true.index)).cumprod()
    return cum_returns, daily_returns

# ---------------------------------------------------------------
# Create a dictionary to hold cumulative return series for each model.
# Loop over each model in df_model_comparison and compute its strategy returns.
# ---------------------------------------------------------------
strategy_returns = {}
for i in range(len(df_model_comparison)):
    model_name = df_model_comparison.loc[i, 'model_name']
    # Extract predicted returns for the test set and convert them to a Series 
    # with the same index as df_compare.
    y_pred = pd.Series(
        df_model_comparison.loc[i, 'y_test_predict'], index=df_compare.index
    )
    # Calculate the strategy cumulative returns using the true returns and predicted returns.
    strategy, _ = calc_strategy_returns(df_compare['y_test'], y_pred)
    strategy_returns[model_name] = strategy

# ---------------------------------------------------------------
# Print the final cumulative return for the Invest & Hold strategy and
# each model-based strategy.
# ---------------------------------------------------------------
print(
    "Invest & Hold Final Cumulative Return: {:.4f}".format(
        invest_hold_return.iloc[-1]
    )
)
for model_name, cum_return in strategy_returns.items():
    print(f"{model_name} Strategy Final Cumulative Return: {cum_return.iloc[-1]:.4f}")

# ---------------------------------------------------------------
# Plot the cumulative return curves for comparison.
# The Invest & Hold curve is plotted in a solid line.
# Each model strategy is plotted with a dashed line.
# ---------------------------------------------------------------
plt.figure(figsize=(12, 6))
plt.plot(
    test_dates, invest_hold_return, label="Invest & Hold", linewidth=2
)
# Plot each model strategy except for the Baseline (since it's equivalent to Invest & Hold).
for model_name, cum_return in strategy_returns.items():
    if model_name != 'Baseline':
        plt.plot(
            test_dates,
            cum_return,
            label=f"{model_name} Strategy",
            linestyle="--"
        )
plt.xlabel("Date")
plt.ylabel("Cumulative Return")
plt.title("Comparison of Strategy Cumulative Returns")
plt.legend()
plt.grid(True)
plt.show()
Invest & Hold Final Cumulative Return: 1.4160
Baseline Strategy Final Cumulative Return: 1.4160
Linear Regression Strategy Final Cumulative Return: 0.8317
Decision Tree Strategy Final Cumulative Return: 1.3419
Random Forest Strategy Final Cumulative Return: 0.8919
XGBoost Strategy Final Cumulative Return: 1.2267
MLP Strategy Final Cumulative Return: 1.3785
LSTM Strategy Final Cumulative Return: 1.4160
1D CNN Strategy Final Cumulative Return: 1.4160
CNN LSTM Strategy Final Cumulative Return: 1.4160

We can see that no model is significantly better than the simple “invest and hold” strategy. The neural network models closely follows the baseline strategy because their predictions for rate of change are positive constants.

6. Conclusion

Although we didn’t find any model that successfully predict the Nasdaq index, we showed that, using this dataset, we cannot use the linear regression, tree based models, and neural network models with the hyperparameter we’ve tried to predict Nasdaq index.

Predicting the financial market and make profit is not an easy task, but machine learning and deep learning is promising tool to do it. We can explore other available data, models, optimization methods to make successful prediction in the future.

Reference

  1. CNNpred: CNN-based stock market prediction using a diverse set of variables https://archive.ics.uci.edu/dataset/554/cnnpred+cnn+based+stock+market+prediction+using+a+diverse+set+of+variables
  2. The idea of RFE and Time Series Cross-Validation are coming from ChatGPT and DeepSeek. The investment simulation part is modified from ChatGPT. Used ChatGPT to check the PEP8 format.
  3. Martingale (probability theory) https://en.wikipedia.org/wiki/Martingale_(probability_theory)
  4. Recursive feature elimination with cross-validation https://scikit-learn.org/stable/auto_examples/feature_selection/plot_rfe_with_cross_validation.html

Created in deepnote.com Created in Deepnote