Kaggle competition: Microsoft Malware Prediction
<SOS> metric: AUC Kaggle data source: microsoft-malware-prediction<feature_engineering>
LABELS = ["HasDetections"]
distinct_cities = train.loc[:, "City"].unique()
means = []
for col in train.columns[5:42]:
temp = []
for city in distinct_cities:
temp.append(train.loc[train.City == city, col].mean())
 means.append(temp)
 city_pvars = pd.DataFrame(columns=["city_var", "means"])
 for i in range(37):
for j in range(len(distinct_cities)) :
city_pvars.loc[i+37*j] = ["P"+str(i+1), means[i][j]]
plt.rcParams['figure.figsize'] =(18.0, 6.0)
 sns.boxplot(x="city_var", y="means", data=city_pvars )<predict_on_test>
predict_list = []
predict_list.append(pd.read_csv(".. /input/hung-the-nguyen/submission_lgbm_5.csv")[LABELS].values)
 predict_list.append(pd.read_csv(".. /input/hung-the-nguyen/submission_lgbm_6.csv")[LABELS].values)
 predict_list.append(pd.read_csv(".. /input/hung-the-nguyen/submission_lgbm_7.csv")[LABELS].values)
 predict_list.append(pd.read_csv(".. /input/hung-the-nguyen/submission_lgbm_8.csv")[LABELS].values)
 predict_list.append(pd.read_csv(".. /input/hung-the-nguyen/submission_lgbm_9.csv")[LABELS].values)
 predict_list.append(pd.read_csv(".. /input/new-blend/super_blend.csv")[LABELS].values)
 predict_list.append(pd.read_csv(".. /input/new-blend/super_blend.csv")[LABELS].values)
 predict_list.append(pd.read_csv(".. /input/new-blend/super_blend.csv")[LABELS].values)
 predict_list.append(pd.read_csv(".. /input/new-blend/super_blend.csv")[LABELS].values)
 predict_list.append(pd.read_csv(".. /input/new-blend/super_blend.csv")[LABELS].values)
<categorify><EOS> 
print("Rank averaging on ", len(predict_list), " files")
 predictions = np.zeros_like(predict_list[0])
 for predict in predict_list:
for i in range(1):
predictions[:, i] = np.add(predictions[:, i], rankdata(predict[:, i])/predictions.shape[0])
 predictions /= len(predict_list)
 submission = pd.read_csv('.. /input/microsoft-malware-prediction/sample_submission.csv')
 submission[LABELS] = predictions
submission.to_csv('super_blend.csv', index=False )