首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Matlab朴素贝叶斯

Matlab朴素贝叶斯
EN

Stack Overflow用户
提问于 2012-01-29 22:12:48
回答 1查看 1.5K关注 0票数 1

你好,我正在使用KDD 1999数据集,我希望将matlab中的朴素贝叶斯应用于它。我想知道的是,kdd数据集是一个494021x42数据数组,如果你注意到下面朴素贝叶斯的代码中的"training“和"target_class”:

代码语言:javascript
复制
training = [1;0;-1;-2;4;0]; % this is the sample data.
target_class = ['posi';'zero';'negi';'negi';'posi';'zero'];
    % This should have the same number of rows as training data but why?

% Training and Testing the classifier (between positive and negative)
test = 10*randn(10,1) % this is for testing. I am generating random numbers.
class  = classify(test,training, target_class, 'diaglinear')  
% This command classifies the test data depening on the given training data using a       Naive Bayes classifier

% diaglinear is for naive bayes classifier; there is also diagquadratic

我想知道的是与知识发现数据集攻击类型相关的"Target_class“?

代码语言:javascript
复制
back dos
buffer_overflow u2r
ftp_write r2l
guess_passwd r2l
imap r2l
ipsweep probe
land dos
loadmodule u2r
multihop r2l
neptune dos
nmap probe
perl u2r
phf r2l
pod dos
portsweep probe
rootkit u2r
satan probe
smurf dos
spy r2l
teardrop dos
warezclient r2l
warezmaster r2l

或者目标类是包含在"test“集合中的列标头吗?i.e

代码语言:javascript
复制
protocol_type: symbolic.
service: symbolic.
flag: symbolic.
src_bytes: continuous.
dst_bytes: continuous.
land: symbolic.
wrong_fragment: continuous.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-01-29 22:21:40

如果您阅读任务定义,例如here,您将看到目标类确实是攻击类型。然而,训练集包含的攻击类型少于测试集。

这样做是为了现实,因为在训练入侵检测算法之后,它必须能够处理与现有攻击类型相近但不相同的新攻击类型。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9053810

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档