### 华为网络AI学习赛2021-硬盘异常检测
[华为网络AI学习赛2021-硬盘异常检测](https://competition.huaweicloud.com/information/1000041370/introduction)
### 特征工程 Filter(2) 方差
``` python
# 省略加载数据
# 省略转为 pandas_dataframe
# 省略train_data_nunique_dropnaTrue=train_data.nunique()
# 使用 describe查看每列的统计信息
# 有一些列很特殊的,其中一列如下图所示
i = 1
for col_name in train_data_nunique_dropnaTrue.index:
print(i," ",col_name,"\n",train_data[col_name].describe(),"\n","------","\n")
i = i+1
```

``` python
# "date_g","serial_number" 不算标准差
# 查看其他列的标准差
# std=0 表示数据基本无波动
# 设置阈值 temp_std < 0.01
std_index_list = []
for col_name in train_data_nunique_dropnaTrue.index:
if col_name not in ["date_g","serial_number"]:
temp_std = train_data[col_name].std()
if temp_std < 0.01:
std_index_list.append(col_name)
print(col_name,temp_std)
```

``` python
# 查看列名和数量
print(std_index_list)
print(len(std_index_list))
```

``` python
# 删除std_index_list的列
# 删除的是 标准差过小,也就是数据波动太小的列
train_data.drop(std_index_list,axis=1,inplace=True)
```
``` python
# 查看数据
train_data
```
### 学习资源和参考资料
[【2021学习赛---硬盘异常检测】2月23号直播ppt](https://bbs.huaweicloud.com/forum/thread-108940-1-1.html)
[【学习赛2021--硬盘异常检测】样例代码](https://bbs.huaweicloud.com/forum/thread-107416-1-1.html)
[【学习赛2021--KPI异常检测】优秀选手usstroot直播baseline代码及ppt](https://bbs.huaweicloud.com/forum/thread-106253-1-1.html)
[网络AI学习赛2021.硬盘异常检测,赛题解读](https://bbs.huaweicloud.com/live/dks_live/202102231900.html)
### 其他学习赛推荐
[华为网络AI学习赛2021-KPI异常检测](https://competition.huaweicloud.com/information/1000041344/introduction)
[华为网络AI学习赛2021-日志异常检测](https://competition.huaweicloud.com/information/1000041371/introduction)
### 备注
1. 感谢老师的教学与课件
2. 欢迎各位同学一起来交流比赛心得^_^
3. 比赛配备了较为丰富的学习资料,有助于新手平稳入门,推荐参赛

