<jupyter_start><jupyter_text>30 Regression Models<jupyter_code>from lazypredict.Supervised import LazyRegressor
from pandas.plotting import scatter_matrix# Scikit-learn packages
from sklearn.linear_model import LinearRegression
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import ExtraTreesRegressor
from sklearn import metrics
from sklearn.metrics import mean_squared_error# Hide warnings
from sklearn.model_selection import train_test_split  

import warnings
warnings.filterwarnings("ignore")

import yfinance as yf
yf.pdr_override()
# input
symbol = 'AMD'
start = '2014-01-01'
end = '2018-08-27'

# Read data 
dataset = yf.download(symbol,start,end)

# Only keep close columns 
dataset.head()
# Creating train test split
X = dataset.drop(columns=['Adj Close'])
y = dataset['Adj Close']

offset = int(X.shape[0] * 0.9)

X_train, y_train = X[:offset], y[:offset]
X_test, y_test = X[offset:], y[offset:]
reg = LazyRegressor(verbose=0, ignore_warnings=False, custom_metric=None)
models, predictions = reg.fit(X_train, X_test, y_train, y_test)
print(models)<jupyter_output>100%|██████████| 42/42 [00:02<00:00, 17.49it/s]
{'fraction_non_alphanumeric': 0.11548556430446194, 'fraction_numerical': 0.03587051618547681, 'mean_word_length': 6.835616438356165, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '5245', 'license': 'MIT', 'n_tokens_mistral': 442, 'n_tokens_neox': 397, 'n_words': 97, 'path': 'Stock_Algorithms/30_Regression_Models.ipynb', 'repo_name': 'sharavsambuu/Deep-Learning-Machine-Learning-Stock', 'size': '1143'}