“Minmaxscaler Python” Réponses codées

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]]
Th3Pirat3

min max scalmer sklearn

from sklearn.preprocessing import MinMaxScaler

scaler = MinMaxScaler()
scaler.fit_transform(X_train)
scaler.transform(X_test)
The Frenchy

Minmaxscaler Python

from numpy import asarray
from sklearn.preprocessing import MinMaxScaler
# define data
data = asarray([[100, 0.001],
				[8, 0.05],
				[50, 0.005],
				[88, 0.07],
				[4, 0.1]])
print(data)
# define min max scaler
scaler = MinMaxScaler()
# transform data
scaled = scaler.fit_transform(data)
print(scaled)
Roland Kovács

Réponses similaires à “Minmaxscaler Python”

Questions similaires à “Minmaxscaler Python”

Plus de réponses similaires à “Minmaxscaler Python” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code