Skip to content

Instantly share code, notes, and snippets.

@roshanvid
Created November 17, 2014 06:12
Show Gist options
  • Save roshanvid/17b9d77cbee8460920f8 to your computer and use it in GitHub Desktop.
Save roshanvid/17b9d77cbee8460920f8 to your computer and use it in GitHub Desktop.
kf = KFold(115, n_folds=5)
for train, test in kf:
regr.fit(x[train], y[train])
print("Training error: ", np.mean((regr.predict(x[train]) - y[train]) ** 2))
print("Test error: ", np.mean((regr.predict(x[test]) - y[test]) ** 2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment