可以使用scikit-learn库中的MinMaxScaler函数实现数据归一化例子
时间: 2024-05-14 18:13:07 浏览: 76
Python机器学习库scikit-learn安装与基本使用教程
Sure, MinMaxScaler is a function in the scikit-learn library that can be used for data normalization. Here is an example:
```
from sklearn.preprocessing import MinMaxScaler
data = [[10, 100], [20, 200], [30, 300]]
scaler = MinMaxScaler()
data_normalized = scaler.fit_transform(data)
print(data_normalized)
```
This will normalize the data such that each feature (column) ranges from 0 to 1.
阅读全文