Skip to content

Instantly share code, notes, and snippets.

@sgodfrey66
Created March 26, 2019 02:48
Show Gist options
  • Save sgodfrey66/dce6a01deb7298b955f0d7cec6a6df87 to your computer and use it in GitHub Desktop.
Save sgodfrey66/dce6a01deb7298b955f0d7cec6a6df87 to your computer and use it in GitHub Desktop.
# Run the model evaluator function to find the best models
# with between 1 and 13 features selecting from the features list
model_df = model_evaluator(X, y, features, 1, len(features))
# Rearrange columns in the data frame
model_df = model_df[['features', 'model', 'no_features', 'intercept', 'coeff', 'R2', 'CV_R2']]
# Sort the resulting data frame to see the best feature sets
model_df.sort_values(by = 'CV_R2', ascending = False).head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment