1. 数据分类可以分为两步
第一步建立模型,通过分析由属性描述的数据集,来建立反映其特性的模型。该步骤也称为是有监督的学习,基于训练集而到处模型,训练集合是已知类别标签的数据对象。第二步使用模型对数据对象inxing分类。首先评估对象分类的准确度或者其他指标,如果可以接受,才使用它来对未知类别标签的对象进行分类。
预测的目的主要是从历史数据记录中自动推导出对给定数据的推广描述,从而能够对实现未知类别的数据进行预测。分类和回归是两类主要的预测问题,分类是预测离散的值,回归是预测连续值。
- 使用训练集
- 提供测试集
- 交叉验证
- 按照比例分割
运行信息:
=== Run information ===
//学习方案以及选项
Scheme: weka.classifiers.trees.J48 -C 0.25 -M 2
//关系名称
Relation: iris
//实例数目
Instances: 150
//属性数目
Attributes: 5
sepallength
sepalwidth
petallength
petalwidth
class
//测试模式
Test mode: evaluate on training data
///分类器模型 (完整的训练集合)
=== Classifier model (full training set) ===
J48 pruned tree
------------------
petalwidth <= 0.6: Iris-setosa (50.0)
petalwidth > 0.6
| petalwidth <= 1.7
| | petallength <= 4.9: Iris-versicolor (48.0/1.0)
| | petallength > 4.9
| | | petalwidth <= 1.5: Iris-virginica (3.0)
| | | petalwidth > 1.5: Iris-versicolor (3.0/1.0)
| petalwidth > 1.7: Iris-virginica (46.0/1.0)
Number of Leaves : 5
Size of the tree : 9
Time taken to build model: 0.05 seconds
=== Evaluation on training set ===
Time taken to test model on training data: 0.01 seconds
总结
=== Summary ===
//正确分类的实例
Correctly Classified Instances 147 98 %
//错误分类的实例
Incorrectly Classified Instances 3 2 %
//Kappa统计: 用于评判分类器的分类结果和随机分类的差异度。K=1表明和分类器和随机分类完全不同;K=0表明二者之间相同;K=-1表明分类器比随机分类效果还差。 值 越接近1 越好。
Kappa statistic 0.97
//平均绝对误差【0,1】
Mean absolute error 0.0233
//均方根误差[0,1]
Root mean squared error 0.108
//相对绝对误差
Relative absolute error 5.2482 %
//相对均方根误差
Root relative squared error 22.9089 %
//案例的覆盖程度 百分数越大越好
Coverage of cases (0.95 level) 98.6667 %
//平均相对区域的大小
Mean rel. region size (0.95 level) 34 %
//实例总数
Total Number of Instances 150
//按照类别的详细准确性
=== Detailed Accuracy By Class ===
TP Rate FP Rate Precision Recall F-Measure MCC ROC Area PRC Area Class
1.000 0.000 1.000 1.000 1.000 1.000 1.000 1.000 Iris-setosa
0.980 0.020 0.961 0.980 0.970 0.955 0.990 0.969 Iris-versicolor
0.960 0.010 0.980 0.960 0.970 0.955 0.990 0.970 Iris-virginica
Weighted Avg. 0.980 0.010 0.980 0.980 0.980 0.970 0.993 0.980
混淆矩阵
=== Confusion Matrix ===
a b c <-- classified as
50 0 0 | a = Iris-setosa
0 49 1 | b = Iris-versicolor
0 2 48 | c = Iris-virginica
所有评论(0)