text_html_output_1.png
from sklearn.decomposition import PCA

from sklearn.preprocessing import StandardScaler

from sklearn.preprocessing import StandardScaler

import pandas as pd

Xtrain = pd.read_csv('../input/sept-2021-filled/train_new.csv')
test = pd.read_csv('../input/sept-2021-filled/test_new.csv')

(Xtrain.shape, test.shape)

y = Xtrain.claim
Xtrain = Xtrain.drop(['id', 'claim'], axis=1)

test_id = test.id
test = test.drop('id', axis=1)

ss = StandardScaler()
ss.fit(Xtrain)
Xtrain = ss.transform(Xtrain)
test = ss.transform(test)

pca = PCA(0.95)
pca.fit(Xtrain)
Xtrain = pca.transform(Xtrain)
test = pca.transform(test)

(Xtrain.shape, test.shape)