Тема 5: Проектирование мультимедиа проектов и модели их разработки
Download 1.83 Mb.
|
3-mavzu-sirtqi
>>> from sklearn.preprocessing import StandardScaler >>> scaler = StandardScaler() >>> scaled_x = scaler.fit_transform(x) >>> scaler.scale_array([ 0.40311289, 4.03112887, 14.04421589]) >>> scaler.mean_array([ 0.65, 6.5 , 20.2 ]) >>> scaler.var_array([1.6250e-01, 1.6250e+01, 1.9724e+02]) >>> scaled_x_array([[-1.36438208, -1.36438208, 0.18512959], [-0.3721042 , -0.3721042 , 1.4952775 ], [ 1.36438208, 1.36438208, -1.23894421], [ 0.3721042 , 0.3721042 , -0.44146288]]) >>> scaled_x.mean().round(decimals=4) 0.0 >>> scaled_x.mean(axis=0) array([ 1.66533454e-16, -1.38777878e-17, 1.52655666e-16]) >>> scaled_x.std(axis=0) array([1., 1., 1.]) >>> scaler.inverse_transform(scaled_x) array([[ 0.1, 1. , 22.8], [ 0.5, 5. , 41.2], [ 1.2, 12. , 2.8], [ 0.8, 8. , 14. ]])
Misol uchun, sklearn.datasets.load_boston() funksiyasi Boston hududi uchun uy narxlari ma'lumotlarini ko'rsatadi (narxlar yangilanmagan!). 506 ta kuzatuv mavjud va kirish matritsasi 13 ta ustunga ega (xususiyatlar):
Yana bir misol sharob bilan bog'liq ma'lumotlar to'plami. Uni sklearn.datasets.load_wine() funksiyasi yordamida olish mumkin:
Download 1.83 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling