image_output_1.png
from sklearn import model_selection

import pandas as pd

import seaborn as sns

import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.preprocessing import OrdinalEncoder, OneHotEncoder
from sklearn.model_selection import train_test_split
from sklearn import pipeline
from sklearn import model_selection
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error
from matplotlib import pyplot as plt
plt.rcParams.update({'figure.figsize': (8.0, 6.0)})
plt.rcParams.update({'font.size': 11})

train = pd.read_csv('../input/30-days-of-ml/train.csv', index_col=0)
test = pd.read_csv('../input/30-days-of-ml/test.csv', index_col=0)

sum(train.isnull().sum())

train['kfold'] = -1
kf = model_selection.KFold(n_splits=5, shuffle=True, random_state=42)
for fold, (train_indices, valid_indices) in enumerate(kf.split(X=train)):
    train.iloc[valid_indices, -1] = fold

def plot_folds(fold, data):
    pass

sns.set_style('whitegrid')
fig, ax = plt.subplots(1, 5, figsize=(20, 4), sharey=True)
for i in range(0, 5):
    plot_folds(i, train[train.kfold == i].target)
plt.show()