Linear Models for Regression — Applied Machine Learning in Python

PHOTO EMBED

Sat Oct 28 2023 07:06:20 GMT+0000 (Coordinated Universal Time)

Saved by @elham469

import numpy as np
from sklearn.model_selection import GridSearchCV
# logspace creates numbers that are evenly spaces in log-space
# it uses a base of 10 by default, here starting from 10^-4 to 10^1, with 6 steps in total
param_grid = {'alpha': np.logspace(-4, 1, 6)}
param_grid
content_copyCOPY

https://amueller.github.io/aml/02-supervised-learning/05-linear-models-regression.html