开始使用免费开始使用

确定需要标准化的特征

在本练习中,您将查看 UFO 数据集各列的方差,以判断哪些特征需要标准化。观察 secondsminutes 两列的方差后,您会发现 seconds 列的方差非常高。由于 secondsminutes 彼此相关(我们在进行建模特征选择时会处理这一问题),现在先对 seconds 列进行对数归一化。

本练习是课程的一部分

Python 中的机器学习预处理

查看课程

练习说明

  • 计算 secondsminutes 两列的方差,并仔细查看结果。
  • seconds 列执行对数归一化,生成名为 seconds_log 的新列。
  • 打印 seconds_log 列的方差。

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Check the variance of the seconds and minutes columns
print(____)

# Log normalize the seconds column
ufo["seconds_log"] = ____

# Print out the variance of just the seconds_log column
print(____)
编辑并运行代码