Kaggle competition: Toxic Comment Classification Challenge
<SOS> metric: MCAUC Kaggle data source: toxic-comment-classification-challenge<train_model>
sns.set(style="darkgrid")
 sns.set(font_scale=1.3)
 warnings.filterwarnings('ignore')
 np.random.seed(37)
 color = sns.color_palette()
train_pool = Pool(X_train_scaled, y_train)
 cat_models = CatBoostRegressor(iterations=10000, loss_function="MAE", boosting_type="Ordered")
 cat_models.fit(X_train_scaled, y_train, silent=True)
 print(cat_models.best_score_)
<predict_on_test>
path = '.. /input/'
comp = 'jigsaw-toxic-comment-classification-challenge/'
EMBEDDING_FILE=f'{path}glove6b50d/glove.6B.50d.txt'
TRAIN_DATA_FILE=f'{path}{comp}train.csv'
TEST_DATA_FILE=f'{path}{comp}test.csv'
test_pool = Pool(X_test, y_test)
 pre = cat_models.predict(X_test)
 print("catboost score:", np.mean(np.abs(y_test - pre)) )<train_model>
embed_size = 50
max_features = 20000
maxlen = 100
rf = RandomForestRegressor(max_depth=2, n_estimators=3000,max_features=40, criterion="mae")
 rf.fit(X_train_scaled, y_train)
<compute_test_metric>
train = pd.read_csv(TRAIN_DATA_FILE)
 test = pd.read_csv(TEST_DATA_FILE)
 list_sentences_train = train["comment_text"].fillna("_na_" ).values
list_classes = ["toxic", "severe_toxic", "obscene", "threat", "insult", "identity_hate"]
y = train[list_classes].values
list_sentences_test = test["comment_text"].fillna("_na_" ).values
print("rf score:", rf.score(X_test, y_test.flatten()))<compute_test_metric>
tokenizer = Tokenizer(num_words=max_features)
 tokenizer.fit_on_texts(list(list_sentences_train))
<init_hyperparams><EOS> 
file_Name = "testfile"
fileObject = open(file_Name,'wb')
 pickle.dump(tokenizer,fileObject )