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)

Here is what the above code is Doing:
1. Importing the train_test_split function from the sklearn.model_selection module.
2. Using train_test_split to split the data into training and test sets.
3. Creating a MinMaxScaler object.
4. Creating a Ridge object.
5. Fitting the MinMaxScaler object to the training data.
6. Transforming the training data using the fitted MinMaxScaler object.
7. Transforming the test data using the fitted MinMaxScaler object.