Kaggle competition: TReNDS Neuroimaging
<SOS> metric: WMAE Kaggle data source: trends-neuroimaging<save_to_csv>
color = sns.color_palette()
py.init_notebook_mode(connected=True)
 init_notebook_mode(connected=True)
 offline.init_notebook_mode()
cf.go_offline()
eng_stopwords = stopwords.words('english')
submission.to_csv("submission.csv",index=False )<load_pretrained>
print('Reading data...')
 loading_data = pd.read_csv(bp+'/loading.csv')
 train_data = pd.read_csv(bp+'/train_scores.csv')
 sample_submission = pd.read_csv(bp+'/sample_submission.csv')
 print('Reading data completed' )
model.save_weights("XLM_R_MNLI_XNLI.h5",overwrite=True )<set_options>
total = train_data.isnull().sum().sort_values(ascending = False)
 percent =(train_data.isnull().sum() /train_data.isnull().count() *100 ).sort_values(ascending = False)
 missing_train_data = pd.concat([total, percent], axis=1, keys=['Total', 'Percent'])
 missing_train_data.head()
!nvidia-smi<install_modules>
total = loading_data.isnull().sum().sort_values(ascending = False)
 percent =(loading_data.isnull().sum() /loading_data.isnull().count() *100 ).sort_values(ascending = False)
 missing_test_data = pd.concat([total, percent], axis=1, keys=['Total', 'Percent'])
 missing_test_data.head()
!pip install git+https://github.com/huggingface/transformers<install_modules>
merged = train_data.merge(loading_data)
!pip install -U nlp<import_modules>
sample_submission.to_csv('sample_submission.csv', index=False )
import pandas as pd
import numpy as np
import torch
import nlp
from transformers import AutoTokenizer, AutoModelForSequenceClassification
from torch.utils.data import DataLoader<set_options>
sub1 = sample_submission.copy()
for i in range(int(len(sub1)/5)) :
sub1.at[i*5+0, 'Predicted']= 50.034068
sub1.at[i*5+1, 'Predicted']= 51.474692
sub1.at[i*5+2, 'Predicted']= 59.244132
sub1.at[i*5+3, 'Predicted']= 47.325130
sub1.at[i*5+4, 'Predicted']= 51.905658
sub1.to_csv('mean_submission.csv', index=False )
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu' )<load_pretrained>
sub = pd.read_csv('.. /input/trends-bob/sub123_6.75.csv')
 sub.to_csv('sub-my.csv', index=False )