1from sklearn import linear_model
2reg = linear_model.Lasso(alpha=0.1).fit(X, y)
3reg.fit(X, y) #We can fit Lasso to the dataset in this way too
4clf.score(X, y) #Return the mean accuracy on the given test data and labels
5cfl.predict(X) #Return the predictions
6
7#Regression Metrics
8#Mean Absolute Error
9
10from sklearn.metrics import mean_absolute_error
11mean_absolute_error(y_true, y_pred)
12
13#Mean Squared Error
14
15from sklearn.metrics import mean_squared_error
16mean_squared_error(y_true, p_pred)
17
18#R2 Score
19
20from sklearn.metrics import r2_score
21r2_score(y_true, y_pred)
22
23#If you like the answer, please upvote -;)