image_output_1.png
from sklearn.compose import make_column_transformer

from sklearn.preprocessing import StandardScaler, RobustScaler,OrdinalEncoder

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

train = pd.read_csv('../input/30-days-of-ml/train.csv')
test = pd.read_csv('../input/30-days-of-ml/test.csv')
ss = pd.read_csv('../input/30-days-of-ml/sample_submission.csv')

train_df = train.drop('id', axis=1)

def get_unique_sum(cat_list):
    pass
cat_lists = list(train.select_dtypes('object').columns)
get_unique_sum(cat_lists)

X = train.drop(['id', 'target'], axis=1)
y = train['target']
test_df = test.drop('id', axis=1)

ct = make_column_transformer((OrdinalEncoder(), cat_lists), (StandardScaler(), ['cont1', 'cont2', 'cont3', 'cont4', 'cont5', 'cont7', 'cont9', 'cont10', 'cont11', 'cont12', 'cont13']), (RobustScaler(), ['cont0', 'cont6', 'cont8']), remainder='passthrough')
X_train = pd.DataFrame(ct.fit_transform(X))
test = pd.DataFrame(ct.fit_transform(test_df))

test.head()