- Deep Learning By Example
- Ahmed Menshawy
- 103字
- 2021-06-24 18:52:45
Scaling
This kind of transformation can be applied to numerical features only.
For example, in the Titanic data, the Age feature can reach 100, but the household income may be in millions. Some models are sensitive to the magnitude of values, so scaling such features will help those models perform better. Also, scaling can be used to squash a variable's values to be within a specific range.
The following code will scale the Age feature by removing its mean from each value and scale to the unit variance:
# scale by subtracting the mean from each value
scaler_processing = preprocessing.StandardScaler()
df_titanic_data['Age_scaled'] = scaler_processing.fit_transform(df_titanic_data['Age'])
推薦閱讀
- 高性能混合信號ARM:ADuC7xxx原理與應用開發
- 商戰數據挖掘:你需要了解的數據科學與分析思維
- Matplotlib 3.0 Cookbook
- 工業機器人工程應用虛擬仿真教程:MotoSim EG-VRC
- 西門子S7-200 SMART PLC實例指導學與用
- Mastering Geospatial Analysis with Python
- 基于ARM9的小型機器人制作
- 工業機器人集成應用
- Linux常用命令簡明手冊
- Generative Adversarial Networks Projects
- 新世紀Photoshop CS6中文版應用教程
- INSTANT R Starter
- 計算機仿真技術
- 局域網組建與管理技術詳解
- 工業機器人設計與實例詳解