Kaggle competition: Toxic Comment Classification Challenge
<SOS> metric: MCAUC Kaggle data source: toxic-comment-classification-challenge<count_values>
enAvg = '.. /input/ensamble-and-max-nbsvm-and-tfidflr/submissionAvg.csv'
enMax = '.. /input/ensamble-and-max-nbsvm-and-tfidflr/submissionMax.csv'
enCond = '.. /input/ensamble-and-max-nbsvm-and-tfidflr/submissionCondMax.csv'
lstm = '.. /input/basic-lstm/submissionLSTM.csv'
app_test.dtypes.value_counts()<categorify>
p_enAvg = pd.read_csv(enAvg)
 p_enMax = pd.read_csv(enMax)
 p_enCond = pd.read_csv(enCond)
 p_lstm = pd.read_csv(lstm )
app_train = pd.get_dummies(app_train)
 app_test = pd.get_dummies(app_test)
 print('Training Features shape: ', app_train.shape)
 print('Testing Features shape: ', app_test.shape )<train_model>
label_cols = ['toxic', 'severe_toxic', 'obscene', 'threat', 'insult', 'identity_hate']
train_labels = app_train['TARGET']
app_train, app_test = app_train.align(app_test, join = 'inner', axis = 1)
 app_train['TARGET'] = train_labels
print('Training Features shape: ', app_train.shape)
 print('Testing Features shape: ', app_test.shape )<train_model>
p_res = p_lstm.copy()
p_res[label_cols] =(p_lstm[label_cols] + p_enCond[label_cols])/ 2
p_res.to_csv('submissionCondLstmAvg.csv', index=False )
app_train['DAYS_EMPLOYED_ANOM'] = app_train['DAYS_EMPLOYED'] == 365243
app_train['DAYS_EMPLOYED'].replace({365243: np.nan}, inplace = True)
 app_test['DAYS_EMPLOYED_ANOM'] = app_test['DAYS_EMPLOYED'] == 365243
app_test['DAYS_EMPLOYED'].replace({365243: np.nan}, inplace = True)
 print('Training Features shape: ', app_train.shape)
 print('Testing Features shape: ', app_test.shape )<feature_engineering>
p_res2 = p_lstm.copy()
for i, j in enumerate(p_res2):
if j == 'id':
continue
temp_df = pd.concat([p_lstm[j], p_enCond[j]], axis=1)
 p_res2[j] = temp_df.apply(lambda r: np.max(r)if np.mean(r)> 0.5 else np.mean(r), axis=1)
 p_res2.to_csv('submissionlstmCondCondMax.csv', index=False )
<load_from_csv><EOS> 
p_res2 = p_lstm.copy()
for i, j in enumerate(p_res2):
if j == 'id':
continue
temp_df = pd.concat([p_lstm[j], p_enCond[j]], axis=1)
 p_res2[j] = temp_df.apply(lambda r: np.max(r)if np.mean(r)> 0.5 else np.min(r), axis=1)
 p_res2.to_csv('submissionlstmCondCondMaxMin.csv', index=False )