Last active
November 15, 2021 00:53
-
-
Save jinhangjiang/040985a2c9f246197eaabbf74921e048 to your computer and use it in GitHub Desktop.
WeightedAverageEnsemble3
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
##### AVERAGE | |
average_pred = (XGB_pred+ | |
KNN_pred+ | |
MLPC_pred+ | |
RandomForest_pred+ | |
DecisionTree_pred)/5 | |
#make submission table | |
FiveModelAveragePrediction = pd.DataFrame( | |
{'QuoteNumber':df, | |
'QuoteConversion_Flag':average_pred}) | |
FiveModelAveragePrediction.to_csv('FiveModelAveragePrediction1.csv', | |
index=False) | |
##### WEIGHTED AVERAGE | |
weighted_average = (0.3*XGB_pred+ | |
0.2*DecisionTree_pred+ | |
0.2*RandomForest_pred+ | |
0.15*MLPC_pred+ | |
0.15*KNN_pred) | |
#make submission table | |
WeightedAveragePrediction = pd.DataFrame( | |
{'QuoteNumber':df, | |
'QuoteConversion_Flag':weighted_average}) | |
WeightedAveragePrediction.to_csv('WeightedAveragePrediction1.csv', | |
index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment