1 Star 0 Fork 0

PAGNHU/DeepLog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dataView.py 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
PAGNHU 提交于 2024-03-28 14:32 . commit
# This is just a data viewing to see there are how many templates, training data and so on.
if __name__ == '__main__':
hdfs_train = []
hdfs_test_normal = []
hdfs_test_abnormal = []
h1 = set()
h2 = set()
h3 = set()
with open('data/hdfs_train', 'r') as f:
for line in f.readlines():
line = tuple(map(lambda n: n - 1, map(int, line.strip().split())))
hdfs_train.append(line)
for line in hdfs_train:
for c in line:
h1.add(c)
with open('data/hdfs_test_normal', 'r') as f:
for line in f.readlines():
line = tuple(map(lambda n: n - 1, map(int, line.strip().split())))
hdfs_test_normal.append(line)
for line in hdfs_test_normal:
for c in line:
h2.add(c)
with open('data/hdfs_test_abnormal', 'r') as f:
for line in f.readlines():
line = tuple(map(lambda n: n - 1, map(int, line.strip().split())))
hdfs_test_abnormal.append(line)
for line in hdfs_test_abnormal:
for c in line:
h3.add(c)
print('train length: %d, template length: %d, template: %s' % (len(hdfs_train), len(h1), h1))
print('test_normal length: %d, template length: %d, template: %s' % (len(hdfs_test_normal), len(h2), h2))
print('test_abnormal length: %d, template length: %d, template: %s' % (len(hdfs_test_abnormal), len(h3), h3))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/panghu-2001/deep-log.git
git@gitee.com:panghu-2001/deep-log.git
panghu-2001
deep-log
DeepLog
master

搜索帮助