text_html_output_1.png
from sklearn.preprocessing import StandardScaler

import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

import math
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
parameters = {'axes.grid': True}
plt.rcParams.update(parameters)
import optuna
from optuna.samplers import TPESampler
import xgboost as xgb
from sklearn.model_selection import train_test_split, cross_val_score, KFold
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import mean_squared_error

df_train = pd.read_csv('../input/tabular-playground-series-aug-2021/train.csv')
df_test = pd.read_csv('../input/tabular-playground-series-aug-2021/test.csv')

df_train.drop('id', axis=1, inplace=True)

df_train.isnull().sum().max() == 0

df_test.drop('id', axis=1, inplace=True)

df_test.isnull().sum().max() == 0

# Plotting some graphs of random features in train set 

fig = plt.figure(figsize = (15, 10))
for j in [j for j in range(1, 16)]:
    i = np.random.randint(0, df_train.columns.size - 1)
    plt.subplot(3, 5, j)
    sns.kdeplot(x = df_train[df_train.columns[i]])
    plt.title(df_train.columns[i])
fig.tight_layout()
print('15 graphs of random features in train set')
plt.show()

df_train_no_target = df_train.drop('loss', axis=1)

scaler = StandardScaler()
df_train_no_target_scal = pd.DataFrame(scaler.fit_transform(df_train_no_target), columns=df_train_no_target.columns)
df_test = pd.DataFrame(scaler.fit_transform(df_test), columns=df_test.columns)

df_test.head()