Kaggle competition: Plant Pathology 2020 - FGVC7
<find_best_params><EOS> 
import pandas as pd
<SOS> metric: MCAUC Kaggle data source: plant-pathology-2020-fgvc7<load_from_csv>
import pandas as pd
X_submit = pd.read_csv('.. /input/test_V2.csv')
 print(X_submit.shape)
 X_submit.head()<categorify>
sub1 = pd.read_csv(
 '.. /input\
/classification-densenet201-efficientnetb7\
/submission.csv' 
)
 sub2 = pd.read_csv(
 '.. /input\
/tf-zoo-models-on-tpu\
/submission.csv' 
)
 sub3 = pd.read_csv(
 '.. /input\
/fork-of-plant-2020-tpu-915e9c\
/submission.csv' 
)
 sub4 = pd.read_csv('.. /input/previous-sub/submission.csv')
X_submit['matchType'] = X_submit.matchType.apply(merge_matchType)
 X_submit.matchType.unique()
X_submit_dumm = pd.get_dummies(X_submit, columns=['matchType'])
 X_submit_dumm.head()
X_submit_dumm = X_submit_dumm.drop('matchType_others', axis=1)
 X_submit = X_submit_dumm.loc[:,['Id', 'groupId', 'matchId', 'assists', 'boosts', 'damageDealt', 'DBNOs',
'headshotKills', 'heals', 'killPlace', 'killPoints', 'kills',
'killStreaks', 'longestKill', 'matchDuration', 'maxPlace', 'numGroups',
'rankPoints', 'revives', 'rideDistance', 'roadKills', 'swimDistance',
'teamKills', 'vehicleDestroys', 'walkDistance', 'weaponsAcquired',
'winPoints', 'matchType_duo', 'matchType_duo-fpp',
'matchType_solo', 'matchType_solo-fpp', 'matchType_squad',
'matchType_squad-fpp']]
X_submit.head()<feature_engineering>
sub = pd.read_csv(
 '.. /input\
/plant-pathology-2020-fgvc7\
/sample_submission.csv'
)
data_store_by_maxPlace_submit = {}
for x in X_submit.maxPlace.unique() :
data_store_by_maxPlace_submit[x] = X_submit.loc[X_submit.maxPlace==x]<predict_on_test>
sub.healthy = sub1.healthy*0.10 \
+ sub2.healthy*0.30 \
+ sub3.healthy*0.60
prediction = {}
for key, value in data_store_by_maxPlace_submit.items() :
maxPlace = key
train_data = value.iloc[:,3:33]
train_data = train_data.drop('maxPlace', axis=1)
 pred_submit = model_store_full[key].predict(train_data)
 pred_submit = adjust_pred(pred_submit, maxPlace)
 prediction[key] = pd.concat([value.Id.reset_index(drop=True), pd.Series(pred_submit, name='winPlacePerc')], axis=1 )<concatenate>
sub.multiple_diseases = sub1.multiple_diseases * 0.10 \
+ sub2.multiple_diseases * 0.30 \
+ sub3.multiple_diseases * 0.60
submission = pd.concat([x for x in prediction.values() ])
 submission.head()<save_to_csv>
sub.rust = sub1.rust*0.10 \
+ sub2.rust*0.30 \
+ sub3.rust*0.60
submission.to_csv('submission.csv', index=False )<save_to_csv>
sub.to_csv('submission.csv', index=False )
<load_from_csv><EOS> 
sub.to_csv('submission.csv', index=False )