Answers for "sklearn linear regression scales?"

1

feature scaling in python

from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
from sklearn.linear_model import Ridge
X_train, X_test, y_train, y_test = train_test_split(X_data, y_data,
                                                   random_state = 0)

X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
Posted by: Guest on April-27-2020
0

data normalization python

from sklearn import preprocessing
normalizer = preprocessing.Normalizer().fit(X_train)  
X_train = normalizer.transform(X_train)
X_test = normalizer.transform(X_test)
Posted by: Guest on January-30-2021

Code answers related to "sklearn linear regression scales?"

Python Answers by Framework

Browse Popular Code Answers by Language