Skip to content

Instantly share code, notes, and snippets.

@ShrashtiSinghal
Created August 6, 2020 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShrashtiSinghal/ded15d56fb235f96e40a3e99bb6b77d4 to your computer and use it in GitHub Desktop.
Save ShrashtiSinghal/ded15d56fb235f96e40a3e99bb6b77d4 to your computer and use it in GitHub Desktop.
#Scale all the attributes except RAD, CHAS, ZN
from sklearn import preprocessing
min_max_scaler = preprocessing.MinMaxScaler()
header_new = ['CRIM', 'INDUS', 'NOX', 'RM', 'AGE','DIS','TAX', 'PTRATIO','B','LSTAT']
x = data.loc[:,header_new]
y = data['MEDV']
x = pd.DataFrame(data=min_max_scaler.fit_transform(x), columns=header_new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment