Matlab朴素贝叶斯

Matlab朴素贝叶斯,matlab,machine-learning,statistics,naivebayes,Matlab,Machine Learning,Statistics,Naivebayes,您好,我使用的是KDD1999数据集,我希望将matlab中的朴素贝叶斯应用于此。我想知道的是kdd数据集是一个494021x42的数据数组,如果您注意到naive bayes代码中下面的“training”和“target_class”: training = [1;0;-1;-2;4;0]; % this is the sample data. target_class = ['posi';'zero';'negi';'negi';'posi';'zero']; % This sho

您好,我使用的是KDD1999数据集,我希望将matlab中的朴素贝叶斯应用于此。我想知道的是kdd数据集是一个494021x42的数据数组,如果您注意到naive bayes代码中下面的“training”和“target_class”:

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
我想知道的是与kdd数据集攻击类型相关的“Target_class”

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
或者目标类是包含在“测试”集中的列标题吗?i、 e


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


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

奇怪的是,这是否意味着训练集中的攻击类型较少,我可能无法从结论中得到任何有意义的东西?你可能会认为测试数据包含的信息会更少,而训练数据包含的信息会更准确。如果你今天训练你的分类,你只能训练到目前为止看到的攻击。可以合理地假设,未来将出现可能与现有攻击相关的新攻击。这是你的任务,以检测这些以及!
protocol_type: symbolic.
service: symbolic.
flag: symbolic.
src_bytes: continuous.
dst_bytes: continuous.
land: symbolic.
wrong_fragment: continuous.