Kaggle competition: Toxic Comment Classification Challenge
df = pd.read_csv('.. /input/application_train.csv', nrows= num_rows)
 test_df = pd.read_csv('.. /input/application_test.csv', nrows= num_rows)
 print("Train samples: {}, test samples: {}".format(len(df), len(test_df)))
 df = df.append(test_df ).reset_index()
del test_df
gc.collect()<categorify>
f_caps_gru = '.. /input/capsule-net-with-gru/submission.csv'
f_dual_embed_pl = '.. /input/submission-dual-embed-pl/submission_dual_embed(2 ).csv'
f_dual_embed_mish = '.. /input/bi-gru-lstm-dual-embedding-with-mish/submission.csv'
f_lstm_glove_tta = '.. /input/improved-lstm-baseline-glove-dropout-trainta/submission.csv'
f_dual_embed_dehyp = '.. /input/improved-lstm-baseline-bi-lstm-dual-embed-dehyp/submission.csv'
f_lstm_fast = '.. /input/improved-lstm-baseline-fasttext-dropout/submission.csv'
f_nbsvm = '.. /input/nb-svm-strong-linear-baseline/submission.csv'
f_bi_post = '.. /input/bi-post/10fold_lstmpp_am.csv'
f_dpcnn = '.. /input/dpcnn-wordcloud/10fold_dpcnn_test.csv'
f_dmcnn = '.. /input/dmcnn-demoji/10fold_dmcnn_am.csv'
f_rcn = '.. /input/rcn-capsule/10fold_capsule_am.csv'
for bin_feature in ['CODE_GENDER', 'FLAG_OWN_CAR', 'FLAG_OWN_REALTY']:
df[bin_feature], uniques = pd.factorize(df[bin_feature])
 df, cat_cols = one_hot_encoder(df, nan_as_category)
 df['DAYS_EMPLOYED'].replace(365243, np.nan, inplace= True )<feature_engineering>
p_caps_gru = pd.read_csv(f_caps_gru)
 p_dual_embed_pl = pd.read_csv(f_dual_embed_pl)
 p_dual_embed_mish = pd.read_csv(f_dual_embed_mish)
 p_lstm_glove_tta = pd.read_csv(f_lstm_glove_tta)
 p_dual_embed_dehyp = pd.read_csv(f_dual_embed_dehyp)
 p_lstm_fast = pd.read_csv(f_lstm_fast)
 p_nbsvm = pd.read_csv(f_nbsvm)
 p_bi_post = pd.read_csv(f_bi_post)
 p_dpcnn = pd.read_csv(f_dpcnn)
 p_dmcnn = pd.read_csv(f_dmcnn)
 p_rcn = pd.read_csv(f_rcn )
df['DAYS_EMPLOYED_PERC'] = df['DAYS_EMPLOYED'] / df['DAYS_BIRTH']
df['INCOME_CREDIT_PERC'] = df['AMT_INCOME_TOTAL'] / df['AMT_CREDIT']
df['INCOME_PER_PERSON'] = df['AMT_INCOME_TOTAL'] / df['CNT_FAM_MEMBERS']
df['ANNUITY_INCOME_PERC'] = df['AMT_ANNUITY'] / df['AMT_INCOME_TOTAL']<define_variables>
label_cols = ['toxic', 'severe_toxic', 'obscene', 'threat', 'insult', 'identity_hate']
p_res = p_caps_gru.copy()
p_res[label_cols] =(p_caps_gru[label_cols] + p_dual_embed_pl[label_cols] + p_dual_embed_mish[label_cols] + p_lstm_glove_tta[label_cols] + p_dual_embed_dehyp[label_cols] + p_lstm_fast[label_cols] + p_nbsvm[label_cols] + p_bi_post[label_cols] * 3 + p_dpcnn[label_cols] * 3 + p_dmcnn[label_cols] * 3 + p_rcn[label_cols] * 3)/ 19
a = df['DAYS_EMPLOYED_PERC'].tolist()
a = [x for x in a if str(x)!= 'nan']
b = df['INCOME_CREDIT_PERC'].tolist()
b = [x for x in b if str(x)!= 'nan']
c = df['INCOME_PER_PERSON'].tolist()
c = [x for x in c if str(x)!= 'nan']
d = df['ANNUITY_INCOME_PERC'].tolist()
d = [x for x in d if str(x)!= 'nan']<train_model>
p_res.to_csv('submission.csv', index=False )