Skip to content

Instantly share code, notes, and snippets.

@jtlqh
Last active October 3, 2019 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtlqh/fef72143a21cc4e402a3694baee9187a to your computer and use it in GitHub Desktop.
Save jtlqh/fef72143a21cc4e402a3694baee9187a to your computer and use it in GitHub Desktop.
comp = pd.read_csv('top 1 sample.csv')
weights = pd.Series({'ridge':0.25, 'lasso':0.25, 'ElasticNet':0.25, 'svm':0.01,'forest':0.01, 'gradient boost':0.1, 'xgboost':0.13})
# adjusting weights to minimize mean square error root with top 1 submission
np.sqrt((((submissions.drop('Id', 1)*weights).sum(axis=1)-comp['SalePrice'])**2).mean())
submissions['blend']=np.round((submissions*weights).sum(axis=1), 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment