MATLAB:使用分类阈值在操作点进行分类

时间:2015-09-29 17:10:25

标签: matlab machine-learning svm roc

我怀疑是概念性的,如下: -

  1. 我使用fitcsvm函数训练SVM分类器。
  2. 然后我使用单独的测试数据测试分类器。我将SVM分数作为输出。
  3. 我也使用perfcurve,它给我分类器的操作点,然后我计算操作点的分数阈值。
  4. 在步骤2中获得的SVM分数:是两列矩阵。
  5. 然后,我想确定与分类器的操作点对应的阈值处的分类结果。

    我该怎么做?

    a)分数矩阵的哪一列用于阈值处理? b)在进行阈值处理时是否考虑了分数的符号?

    以下几行可能会给出我所面对的背景:

    >> [spec,sens,thresh,AUC,OPT,~,~] = perfcurve(test_label,test_score(:,2),1);
    
    >> OPT
    
    ans =
    
        0.1944    0.9181
    
    >> threshold_operating_point = thresh((spec==opt(1))&(Y==opt(2)));
    
    threshold_operating_point =
    
        0.6884
    
    This is the classifier threshold for the operating point. I want to compute the classification results for this operating point. 
    
    >> [~,test_score] = predict(model_trained,train_feat);
    
    >> test_score 
    
    >> test_score = 
    
    -1.00022448638507   1.00022448638507
    -0.999807139595139  0.999807139595139
    -1.00021846153188   1.00021846153188
    -1.00022337382631   1.00022337382631
    -1.00018760991968   1.00018760991968
    -1.00023087489260   1.00023087489260
    0.311552801717325   -0.311552801717325
    0.311552211659033   -0.311552211659033
    0.311552038402263   -0.311552038402263
    0.311552212406740   -0.311552212406740
    

    如您所见,它有两列。我使用哪一列来评分分数?此外,分数的迹象如何重要?我基本上想要使用操作点的阈值并精确定位,这是真正的积极因素,误报,真阴性和假阴性。

0 个答案:

没有答案