"""
# Imports
"""
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
"""
# Load dataset
"""
train = pd.read_csv('../input/tabular-playground-series-aug-2021/train.csv')
test = pd.read_csv('../input/tabular-playground-series-aug-2021/test.csv')
print('train shape:',train.shape)
print('test shape:',test.shape)
train.head()
# Train data
X=train.drop(columns = ['loss','id'])
y=train['loss'].values

# Test data
X_test=test.drop(columns = ['id'])
print('Train set:', X.shape)
print('Test set:', X_test.shape)
"""
# Train Catboost model
"""
from catboost import CatBoostRegressor

model = CatBoostRegressor(random_state = 44,
                         thread_count = 4,
                         verbose = False,
                         loss_function = 'RMSE',
                         eval_metric = 'RMSE',
                         od_type = "Iter",
                         early_stopping_rounds = 500,
                         iterations = 10000,
                         task_type = "CPU")
model.fit(X, y, verbose=0)
"""
# Model performance
"""
from sklearn import metrics

print('R2 score: ', model.score(X, y))
predicted = model.predict(X)
rmse = metrics.mean_squared_error(y, predicted, squared=False)
print('RMSE: ', rmse)
"""
# Prediction
"""
y_pred = model.predict(X_test)
"""
# Submission
"""
preds = pd.read_csv("../input/tabular-playground-series-aug-2021/sample_submission.csv")
preds.loss = y_pred
preds.head()
preds.to_csv('submission_catboost_101.csv', index=False)