Scaling of Features |
import pandas
from sklearn import linear_model
from sklearn.preprocessing import StandardScaler
scale = StandardScaler()
fp = pandas.read_csv("products.csv")
Xpoints = fp[['price', 'quantity']]
scaledXpoints = scale.fit_transform(Xpoints)
print(scaledXpoints)
|
[[-1.59336644 -2.10389253]
[-1.07190106 -0.55407235]
[-1.59336644 -1.52166278]
[-1.85409913 -1.78973979]
[-0.28970299 -0.63784641]
[-1.59336644 -1.52166278]
[-0.55043568 -0.76769621]
[-0.28970299 0.3046118 ]
[-0.28970299 -0.7551301 ]
[-0.0289703 -0.59595938]
[-1.33263375 -1.30803892]
[-0.81116837 -1.26615189]
[-1.59336644 -0.7551301 ]
[-0.0289703 -0.16871166]
[-0.0289703 0.14125238]
[-0.0289703 0.15800719]
[-0.0289703 0.3046118 ]
[ 1.53542584 -0.05142797]
[-0.0289703 -0.72580918]
[ 1.01396046 0.14962979]
[-0.0289703 1.2219378 ]
[ 1.01396046 0.5685001 ]
[ 1.27469315 0.3046118 ]
[-0.0289703 0.51404696]
[ 1.01396046 0.51404696]
[-0.28970299 0.72348212]
[ 1.01396046 0.8281997 ]
[ 1.01396046 1.81254495]
[-0.0289703 0.96642691]
[ 1.01396046 1.72877089]
[ 1.27469315 1.30990057]
[ 1.01396046 1.90050772]
[-0.0289703 -0.23991961]
[-0.0289703 0.40932938]
[-0.0289703 0.47215993]
[ 2.31762392 0.4302729 ]]
|