Kaggle competition: Jigsaw Multilingual Toxic Comment Classification
grid_results['hyperparameters'] = grid_results['hyperparameters'].map(ast.literal_eval)
 random_results['hyperparameters'] = random_results['hyperparameters'].map(ast.literal_eval )<choose_model_class>
sub5 = pd.read_csv('/kaggle/input/009474-fork009473-xlmrobertawithconv/submission(98 ).csv')
 sub18 = pd.read_csv('/kaggle/input/009469-finetunedxlmrlargefastxlmroberta/submission - 2020-06-21T180227.893.csv')
 sub24 = pd.read_csv('/kaggle/input/9423-v/submission - 2020-06-21T215335.038.csv')
 sub4 = pd.read_csv('/kaggle/input/009474-fork009473-xlmrobertawithconv1/submission(99 ).csv')
 sub3 = pd.read_csv('/kaggle/input/009474-009474-fork009473/submission(97 ).csv')
 sub25 = pd.read_csv('/kaggle/input/009406/submission(21 ).csv')
 sub26 = pd.read_csv('/kaggle/input/009383/submission(17 ).csv')
 sub2 = pd.read_csv('/kaggle/input/009471-ensembleversion96-submission-27/submission - 2020-06-21T175246.715.csv')
 sub19 = pd.read_csv('/kaggle/input/009469-finetunedlarge-superfastxlmroberta/submission - 2020-06-21T180023.388.csv')
 sub6 = pd.read_csv('/kaggle/input/009475/submission(90 ).csv')
 sub1 = pd.read_csv('/kaggle/input/009476/submission(95 ).csv')
 sub27 = pd.read_csv('/kaggle/input/009259/submission(16 ).csv')
 sub20 = pd.read_csv('/kaggle/input/009469-finetunedlarge-superfastxlmroberta/submission - 2020-06-21T180023.388.csv')
 sub7 = pd.read_csv('/kaggle/input/009471-ensembleversion96-submission-27/submission - 2020-06-21T175246.715.csv')
 sub8 = pd.read_csv('/kaggle/input/009472-howlingwithwolf-tfidfsubmission-27/submission - 2020-06-21T173345.640.csv')
 sub28 = pd.read_csv('/kaggle/input/009248/submission(15 ).csv')
 sub29 = pd.read_csv('/kaggle/input/9422-v/submission - 2020-06-21T220028.429.csv')
 sub21 = pd.read_csv('/kaggle/input/9462-v/submission - 2020-06-21T210004.249.csv')
 sub30 = pd.read_csv('/kaggle/input/009383/submission(17 ).csv')
 sub9 = pd.read_csv('/kaggle/input/009474-009474-fork009473/submission(97 ).csv')
 sub31 = pd.read_csv('/kaggle/input/009259/submission(16 ).csv')
 sub10 = pd.read_csv('/kaggle/input/009475/submission(90 ).csv')
 sub22 = pd.read_csv('/kaggle/input/009469-finetunedxlmrlargefastxlmroberta/submission - 2020-06-21T180227.893.csv')
 sub32 = pd.read_csv('/kaggle/input/009423/submission(48 ).csv')
 sub33 = pd.read_csv('/kaggle/input/009354/submission(25 ).csv')
 sub34 = pd.read_csv('/kaggle/input/9459-vv/submission - 2020-06-21T214937.374.csv')
 sub11 = pd.read_csv('/kaggle/input/009471-submission-27-submission-72/submission - 2020-06-21T175653.332.csv')
 sub35 = pd.read_csv('/kaggle/input/009406/submission(21 ).csv')
 sub12 = pd.read_csv('/kaggle/input/009474-fork009473-xlmrobertawithconv/submission(98 ).csv')
 sub36 = pd.read_csv('/kaggle/input/9423-v/submission - 2020-06-21T215335.038.csv')
 sub13 = pd.read_csv('/kaggle/input/009474-fork009473-xlmrobertawithconv1/submission(99 ).csv')
 sub37 = pd.read_csv('/kaggle/input/9398-v/submission - 2020-06-21T205031.461.csv')
 sub14 = pd.read_csv('/kaggle/input/009473-version6-robertaaugmentationssl09417/submission(100 ).csv')
 sub38 = pd.read_csv('/kaggle/input/9459-vv/submission - 2020-06-21T214937.374.csv')
 sub15 = pd.read_csv('/kaggle/input/009472-howlingwithwolf-tfidfsubmission-27/submission - 2020-06-21T173345.640.csv')
 sub23 = pd.read_csv('/kaggle/input/9462-v/submission - 2020-06-21T210004.249.csv')
 sub39 = pd.read_csv('/kaggle/input/009248/submission(15 ).csv')
 sub16 = pd.read_csv('/kaggle/input/9467-xlmrlargexlmrobertasubmission-47/submission - 2020-06-21T181840.475.csv')
 sub17 = pd.read_csv('/kaggle/input/009472-tputrainingsuper-ensembleversion96/submission - 2020-06-21T173040.684.csv' )
def evaluate(results, name):

 results = results.sort_values('score', ascending = False ).reset_index(drop = True)
 print('The highest cross validation score from {} was {:.5f} found on iteration {}.'.format(name, results.loc[0, 'score'], results.loc[0, 'iteration']))
hyperparameters = results.loc[0, 'hyperparameters']
model = lgb.LGBMClassifier(**hyperparameters)
 model.fit(train_features, train_labels)
 preds = model.predict_proba(test_features)[:, 1]
print('ROC AUC from {} on test data = {:.5f}.'.format(name, roc_auc_score(test_labels, preds)))
 hyp_df = pd.DataFrame(columns = list(results.loc[0, 'hyperparameters'].keys()))
for i, hyp in enumerate(results['hyperparameters']):
hyp_df = hyp_df.append(pd.DataFrame(hyp, index = [0]),
ignore_index = True)
 hyp_df['iteration'] = results['iteration']
hyp_df['score'] = results['score']
return hyp_df<find_best_params>
sub_70=['/kaggle/input/009474-fork009473-xlmrobertawithconv/submission(98 ).csv',
'/kaggle/input/009474-fork009473-xlmrobertawithconv1/submission(99 ).csv',
'/kaggle/input/009474-009474-fork009473/submission(97 ).csv',
'/kaggle/input/009471-ensembleversion96-submission-27/submission - 2020-06-21T175246.715.csv',
'/kaggle/input/009475/submission(90 ).csv',
'/kaggle/input/009476/submission(95 ).csv',
'/kaggle/input/009471-ensembleversion96-submission-27/submission - 2020-06-21T175246.715.csv',
'/kaggle/input/009472-howlingwithwolf-tfidfsubmission-27/submission - 2020-06-21T173345.640.csv',
'/kaggle/input/009474-009474-fork009473/submission(97 ).csv',
'/kaggle/input/009475/submission(90 ).csv',
'/kaggle/input/009471-submission-27-submission-72/submission - 2020-06-21T175653.332.csv',
'/kaggle/input/009474-fork009473-xlmrobertawithconv/submission(98 ).csv',
'/kaggle/input/009474-fork009473-xlmrobertawithconv1/submission(99 ).csv',
'/kaggle/input/009473-version6-robertaaugmentationssl09417/submission(100 ).csv',
'/kaggle/input/009472-howlingwithwolf-tfidfsubmission-27/submission - 2020-06-21T173345.640.csv',
'/kaggle/input/9467-xlmrlargexlmrobertasubmission-47/submission - 2020-06-21T181840.475.csv',
'/kaggle/input/009472-tputrainingsuper-ensembleversion96/submission - 2020-06-21T173040.684.csv']
sub_60=['/kaggle/input/009469-finetunedxlmrlargefastxlmroberta/submission - 2020-06-21T180227.893.csv',
'/kaggle/input/009469-finetunedlarge-superfastxlmroberta/submission - 2020-06-21T180023.388.csv',
'/kaggle/input/9462-v/submission - 2020-06-21T210004.249.csv',
'/kaggle/input/009469-finetunedxlmrlargefastxlmroberta/submission - 2020-06-21T180227.893.csv',
'/kaggle/input/9462-v/submission - 2020-06-21T210004.249.csv']
sub_un=['/kaggle/input/9423-v/submission - 2020-06-21T215335.038.csv',
'/kaggle/input/009406/submission(21 ).csv',
'/kaggle/input/009383/submission(17 ).csv',
'/kaggle/input/009259/submission(16 ).csv',
'/kaggle/input/009248/submission(15 ).csv',
'/kaggle/input/9422-v/submission - 2020-06-21T220028.429.csv',
'/kaggle/input/009383/submission(17 ).csv',
'/kaggle/input/009259/submission(16 ).csv',
'/kaggle/input/009423/submission(48 ).csv',
'/kaggle/input/009354/submission(25 ).csv',
'/kaggle/input/9459-vv/submission - 2020-06-21T214937.374.csv',
'/kaggle/input/009406/submission(21 ).csv',
'/kaggle/input/9423-v/submission - 2020-06-21T215335.038.csv',
'/kaggle/input/9398-v/submission - 2020-06-21T205031.461.csv',
'/kaggle/input/9459-vv/submission - 2020-06-21T214937.374.csv',
'/kaggle/input/009248/submission(15 ).csv']
grid_hyp = evaluate(grid_results, name = 'grid search' )<find_best_params>
sub1 = pd.read_csv('/kaggle/input/009476/submission(95 ).csv')
 sub2 = pd.read_csv('/kaggle/input/tfidf-v-44/submission(94 ).csv')
 sub3 = pd.read_csv('/kaggle/input/009475-vv/submission - 2020-06-22T112115.366.csv' )
random_hyp = evaluate(random_results, name = 'random search' )<set_options>
sub1['toxic'] = sub1['toxic']*0.9 + sub2['toxic']*0.1
<prepare_output><EOS> 
sub1.to_csv('submission.csv', index=False )