建议使用以下浏览器,以获得最佳体验。 IE 9.0+以上版本 Chrome 31+ 谷歌浏览器 Firefox 30+ 火狐浏览器
温馨提示

抱歉,您需设置社区昵称后才能参与社区互动!

前往修改
我再想想

华为云大赛技术圈

话题 : 467 成员 : 405

加入HCSD

【学习赛2021-硬盘异常检测】【总结分享】特征工程 Filter(2) 方差

年月日 2021/3/1 676
### 华为网络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 ``` ![naie-feature-filter-std-1.png](https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/forums/attachment/forum/202102/27/001730hndsazsm1qltthbb.png) ``` 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) ``` ![naie-feature-filter-std-2.png](https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/forums/attachment/forum/202102/27/001738m27zkcvxm6p9wiie.png) ``` python # 查看列名和数量 print(std_index_list) print(len(std_index_list)) ``` ![naie-feature-filter-std-3.png](https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/forums/attachment/forum/202102/27/001930g8fnygfkjbp6ns00.png) ``` 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. 比赛配备了较为丰富的学习资料,有助于新手平稳入门,推荐参赛

回复 (0)

没有评论
上划加载中
标签
您还可以添加5个标签
  • 没有搜索到和“关键字”相关的标签
  • 云产品
  • 解决方案
  • 技术领域
  • 通用技术
  • 平台功能
取消

年月日

角色:成员

话题:25

发消息
发表于2021年03月01日 16:27:09 6760
直达本楼层的链接
楼主
正序浏览 只看该作者
[技术干货] 【学习赛2021-硬盘异常检测】【总结分享】特征工程 Filter(2) 方差

### 华为网络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 ``` ![naie-feature-filter-std-1.png](https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/forums/attachment/forum/202102/27/001730hndsazsm1qltthbb.png) ``` 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) ``` ![naie-feature-filter-std-2.png](https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/forums/attachment/forum/202102/27/001738m27zkcvxm6p9wiie.png) ``` python # 查看列名和数量 print(std_index_list) print(len(std_index_list)) ``` ![naie-feature-filter-std-3.png](https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/forums/attachment/forum/202102/27/001930g8fnygfkjbp6ns00.png) ``` 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. 比赛配备了较为丰富的学习资料,有助于新手平稳入门,推荐参赛
点赞 举报
分享

分享文章到朋友圈

分享文章到微博

游客

您需要登录后才可以回帖 登录 | 立即注册