Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sklearn standardscaler to selected column only

# PYTHON

cols_to_scale= ['Alcohol','Gdp','Population', 'Percentage expenditure', 'Schooling']

X_train[cols_to_scale]=scaler.fit_transform(X_train[cols_to_scale])
X_test[cols_to_scale]=scaler.transform(X_test[cols_to_scale])
 
PREVIOUS NEXT
Tagged: #sklearn #standardscaler #selected #column
ADD COMMENT
Topic
Name
1+1 =