-
大小: 1KB文件類型: .rar金幣: 1下載: 0 次發(fā)布日期: 2021-03-16
- 語(yǔ)言: Matlab
- 標(biāo)簽: MATLAB??ROC數(shù)據(jù)??roc??
資源簡(jiǎn)介
matlab繪制ROC曲線代碼,一種用于數(shù)據(jù)分類時(shí),分類準(zhǔn)確率的評(píng)價(jià)方法。
代碼片段和文件信息
function?auc?=?plotroc(yxparams)
%plotroc?draws?the?recevier?operating?characteristic(ROC)?curve.
%
%auc?=?plotroc(training_label?training_instance?[?libsvm_options?-v?cv_fold])?
%??Use?cross-validation?on?training?data?to?get?decision?values?and?plot?ROC?curve.
%
%auc?=?plotroc(testing_label?testing_instance?model)?
%??Use?the?given?model?to?predict?testing?data?and?obtain?decision?values
%??for?ROC
%
%?Example:
%???
%? load(‘heart_scale.mat‘);?
%? plotroc(heart_scale_label?heart_scale_inst‘-v?5‘);
%
% [yx]?=?libsvmread(‘heart_scale‘);
%??? model?=?svmtrain(yx);
%? plotroc(yxmodel);
rand(‘state‘0);?%?reset?random?seed
if?nargin?2
help?plotroc
return
elseif?isempty(y)?|?isempty(x)
error(‘Input?data?is?empty‘);
elseif?sum(y?==?1)?+?sum(y?==?-1)?~=?length(y)
error(
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????3047??2015-03-16?22:44??plotroc.m
-----------?---------??----------?-----??----
?????????????????3047????????????????????1
評(píng)論
共有 條評(píng)論