Last active
October 3, 2019 12:55
-
-
Save jtlqh/fef72143a21cc4e402a3694baee9187a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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