当前位置:网站首页>日志特征选择汇总(基于天池比赛)
日志特征选择汇总(基于天池比赛)
2022-07-08 00:08:00 【Mark_Aussie】
数据是基于第三届阿里云磐久智维算法大赛,
官方地址:第三届阿里云磐久智维算法大赛赛题与数据-天池大赛-阿里云天池 (aliyun.com)
亚军方案gihub:AI-Competition/3rd_PanJiu_AIOps_Competition at main · yz-intelligence/AI-Competition · GitHub
本赛题提供了故障工单与日志数据,分析msg的结构,根据|可以将其分解。根据实际的业务场景,在故障发生的前后5/10/15/30分钟或更久产生的日志信息,都可能与此故障有关。


sn代表服务器序列号,故障工单中共有13700+个sn;
服务器型号server_model和服务器序列号sn是一对多的关系;
将msg经过TF-IDF编码,输入到线性模型中,使用eli5得出每个类别下,msg单词的贡献程度,权重越高表示区分该类别的贡献越大。
0类和1类表示CPU相关故障,processor的权重都是最高的,且区分度不是很高;
2类表示内存相关故障,权重较高的是memory、mem、ecc;
3类表示其他类型故障,权重较高的是hdd、fpga、bus,可能是和硬件相关的故障。

主要步骤:数据预处理,特征工程,特征选择,模型训练,模型融合。
数据预处理:按照距离故障发生时间的间隔,将日志分成不同的时间区间;msg根据特殊符号进行标准化。
特征工程:主要构建关键词特征、时间差特征、TF-IDF词频统计特征、W2V特征、统计特征、New Data特征。
特征选择:对抗验证进行特征选择,保证训练和测试集的一致性,提高模型在测试集的泛化能力。
模型训练:CatBoost与LightGBM使用伪标签技术进行模型训练。
模型融合:CatBoost与LightGBM的预测结果以8:2进行加权融合得到最终的模型预测结果。
根据实际业务场景,故障发生之前可能会有预警日志产生,故障发生之后可能会产生日志风暴,对每一条故障工单数据,按照不同的时间切分构造新的日志数据,按照日志聚合之后构造统计特征。
特征工程:
时间差特征
反映故障日志与正常日志发生的间隔。特征构造方法:
获取日志时间和故障发生时间的时间差,结合
sn, server_model进行分组特征衍生。时间差的统计特征:
[max, min, median, std, var, skw, sum, mode]时间差的分位数特征:
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]时间差差分:
[max, min, median, std, var, skw, sum]
关键词特征
关键词对各类别的影响。构造关键词特征首先要找到关键词,两种方法确定关键词:
方案1:msg 做TF-IDF编码,输入到线性模型中,计算每个类别下关键词的权重,取每个类别的TOP20。
方案2:根据' | '对 msg 分词,统计每个类别的词频占比,取每个类别的TOP20。
方法1与方法2取并集,得到最终的关键词。
将每个关键词在msg中出现与否作为特征。
统计特征:根据类别特征分组构造统计特征,使类别特征隐藏的信息充分暴露出来。
根据
sn分组,server_mode统计特征:[count,nunique,freq,rank]根据
sn分组,日志统计特征:msg, msg_0, msg_1, msg_2:[count,nunique,freq,rank]
W2V特征:反映msg的语义信息
根据
sn分组,按照时间对msg进行排序,对于每一个sn,将排序好的msg作为一个序列,提取embedding特征。
TFIDF特征
根据 fault_id(sn+fault_time)分组,根据fault_id将msg拼接作为一个序列,提取TF-IDF特征。
特征选择
特征选择环节主要是使用对抗验证进行特征选择,将训练集与测试集删除label重新打标,训练集为1,测试集为0,数据集合并进行模型训练计算AUC,如果AUC大于设定好的阈值,将特征重要性最高的特征删除,重新训练模型。直至AUC小于阈值。
在模型训练的时候,使用伪标签技术,具体是将A、B榜测试集的预测结果,选取置信度>0.85的样本作为可信样本,加入到训练集中,达到增大样本量的目的。
参考:
边栏推荐
- [loss function] entropy / relative entropy / cross entropy
- 云原生应用开发之 gRPC 入门
- nacos-微服务网关Gateway组件 +Swagger2接口生成
- Matlab code about cosine similarity
- Gnuradio 3.9 using OOT custom module problem record
- 液压旋转接头的使用事项
- 2022 chemical automation control instrument examination summary and chemical automation control instrument simulation examination questions
- Qt - - Packaging Programs - - Don't install Qt - can run directly
- DataWorks值班表
- 如何让导电滑环信号更好
猜你喜欢

Anaconda3 download address Tsinghua University open source software mirror station

Redux usage

如何让导电滑环信号更好

Understanding of maximum likelihood estimation

Kindle operation: transfer downloaded books and change book cover

Sword finger offer II 041 Average value of sliding window

About snake equation (1)

2022 safety officer-b certificate examination question bank and safety officer-b certificate simulation test questions

2022 safety officer-a certificate free examination questions and safety officer-a certificate mock examination

2022 chemical automation control instrument examination summary and chemical automation control instrument simulation examination questions
随机推荐
Redis cluster
用户之声 | 冬去春来,静待花开 ——浅谈GBase 8a学习感悟
GBASE观察 | 数据泄露频发 信息系统安全应如何守护
Tencent game client development interview (unity + cocos) double bombing social recruitment 6 rounds of interviews
Understanding of maximum likelihood estimation
Matlab code about cosine similarity
Optimization of ecological | Lake Warehouse Integration: gbase 8A MPP + xeos
Understanding of prior probability, posterior probability and Bayesian formula
break net
Frequency probability and Bayesian probability
Gnuradio transmits video and displays it in real time using VLC
Kafka connect synchronizes Kafka data to MySQL
The foreach map in JS cannot jump out of the loop problem and whether foreach will modify the original array
The beauty of Mathematics -- the principle of fine Fourier transform
The solution of frame dropping problem in gnuradio OFDM operation
The usage of rand function in MATLAB
Gnuradio 3.9 using OOT custom module problem record
不算不知道,花呗分期的真实利率居然这么高
5. Discrete control and continuous control
Redux usage