Chapter 20 :End to End Project - Bikes Assessment - Basic - Train and Analyze the Models - Train Linear Regression Model


#1

Executed below code :

lin_reg=LinearRegression()
lr_mae_scores = -cross_val_score(lin_reg,trainingCols,trainingLabels,cv=10,scoring=“neg_mean_absolute_error”)
display_scores(lr_mae_scores)
lr_mse_scores = np.sqrt(-cross_val_score(lin_reg,trainingCols,trainingLabels,cv=10,scoring=“neg_mean_squared_error”))

display_scores(lr_mse_scores)

Got Below output :
Scores: [ 66.96340699 80.48809095 113.84704981 93.17230086 76.11197672
96.5220689 133.13798218 158.02254734 158.90195479 127.15674717]
Mean: 110.43241256942201
Standard deviation: 31.426965705295725
Scores: [ 84.63836676 111.12038541 131.88324414 119.16350622 105.17621319
127.72562924 174.97188817 187.31691741 205.60028279 164.30585678]
Mean: 141.1902290118175
Standard deviation: 37.55565075919573

But on submitting the answer getting error “lin_reg not defined”