Skip to content

Instantly share code, notes, and snippets.

@Shikhargupta
Created May 12, 2020 14:20
Show Gist options
  • Select an option

  • Save Shikhargupta/02c03478ced89986778732a9352105d6 to your computer and use it in GitHub Desktop.

Select an option

Save Shikhargupta/02c03478ced89986778732a9352105d6 to your computer and use it in GitHub Desktop.
###################### Parameter sweeping ##########################
val_list = []
score_list = []
for x in np.arange(10,300,10):
model = Ridge(alpha=x)
model.fit(X_train,np.log(y_train))
y_pred = np.exp(model.predict(X_test))
score_list.append(np.sqrt(metrics.mean_squared_error(np.log(y_test), np.log(y_pred))))
val_list.append(x)
sns.lineplot(x=val_list, y=score_list, markers=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment