text_plain_output_1.png
import matplotlib as mpl

import numpy as np

import pandas as pd

import seaborn as sns

import sklearn as sk

import tensorflow as tf

import xgboost as xgb

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

X_full.isnull().sum()

categorical_features = [cname for cname in X_full.columns if X_full[cname].nunique() <= 15 and X_full[cname].dtype == 'object']
numeric_features = [cname for cname in X_full.columns if X_full[cname].dtype in ['int64', 'float64']]
my_features = categorical_features + numeric_features
numeric_features.remove('target')

categorical_features = [cname for cname in X_train_full.columns if X_train_full[cname].nunique() <= 15 and X_train_full[cname].dtype == 'object']
numeric_features = [cname for cname in X_train_full.columns if X_train_full[cname].dtype in ['int64', 'float64']]
my_features = categorical_features + numeric_features

X_train = X_train_full[my_features]
X_valid = X_valid_full[my_features]
X_test = X_test_full[my_features]

X_train.head()