Kaggle competition: Natural Language Processing with Disaster Tweets
<SOS> metric: meanfscore Kaggle data source: natural-language-processing-with-disaster-tweets<string_transform>
target = pd.read_csv('.. /input/nlp-getting-started/train.csv')['target']
train = pd.read_csv('.. /input/nlp-getting-started/train.csv')[['text']]
test = pd.read_csv('.. /input/nlp-getting-started/test.csv')[['text']]
ssub = pd.read_csv('.. /input/nlp-getting-started/sample_submission.csv')
 embed = hub.load("https://tfhub.dev/google/universal-sentence-encoder/3")
 X_train_embeddings = embed(train.text.values)
 X_test_embeddings = embed(test.text.values)
 params = {
'learning_rate': 0.04,
'n_estimators': 1500,
'colsample_bytree': 0.4,
'metric':'auc'
}
text_clf = LGBMClassifier(**params)
 text_clf.fit(X_train_embeddings['outputs'][:5000,:], target.values[:5000],
eval_set=[(X_train_embeddings['outputs'][:5000,:], target.values[:5000]), 
(X_train_embeddings['outputs'][5000:,:], target.values[5000:])],
verbose=200, early_stopping_rounds=20, 
)
 text_clf.fit(X_train_embeddings['outputs'][:5000,:], target.values[:5000])
 Y_pred = text_clf.predict(X_train_embeddings['outputs'][5000:])
 print(metrics.classification_report(target[5000:], Y_pred, digits=3),)
 print(metrics.confusion_matrix(target[5000:], Y_pred))
<feature_engineering><EOS> 
text_clf.fit(X_train_embeddings['outputs'], target.values)
 pred_test = text_clf.predict(X_test_embeddings['outputs'])
 ssub["target"] = pred_test
ssub.to_csv('submission.csv',index=False )