hamming_loss.m
来自「Multi-label learning by instance differe」· M 代码 · 共 8 行
M
8 行
function HammingLoss=Hamming_loss(Pre_Labels,test_target)
%Computing the hamming loss
%Pre_Labels: the predicted labels of the classifier, if the ith instance belong to the jth class, Pre_Labels(j,i)=1, otherwise Pre_Labels(j,i)=-1
%test_target: the actual labels of the test instances, if the ith instance belong to the jth class, test_target(j,i)=1, otherwise test_target(j,i)=-1
[num_class,num_instance]=size(Pre_Labels);
miss_pairs=sum(sum(Pre_Labels~=test_target));
HammingLoss=miss_pairs/(num_class*num_instance);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?