min max scaler sklearn
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
scaler.fit_transform(X_train)
scaler.transform(X_test)
min max scaler sklearn
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
scaler.fit_transform(X_train)
scaler.transform(X_test)
Python MinMaxScaler()
from sklearn.preprocessing import MinMaxScaler
#Normal minmaxscaler function to standarise data.
data = [[-1, 2], [-0.5, 6], [0, 10], [1, 18]]
scaler = MinMaxScaler()
scaler.fit(data)
#get data for Max and Min from scaler functions,
#best to store it in a dictionary and use it later make data normal again
print(scaler.transform([[2, 2]]))
Out>>> [[ 1.5 0. ]]
# Inverse transform the the 0-1 dataframe.
print(scaler.inverse_transform([[ 1.5 0. ]]))
Out>>> [[ 2.0 2.0]]
minmax python
# Were you looking for min max python?
# if this is the case (works also with sets and numpy array)
>>> l = [1,2,8,4,7,9,6,3]
>>> min(l)
1
>>> max(l)
9
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us