Notebook6 compares two classifiers on multiple datasets using left rope right


Print all the p-values for the comparison of all 5 classifiers on multiple datasets


In [4]:
using HypothesisTests
ClassID = readdlm("Data/ClassifierID.dat", ',')
ClassNames = readdlm("Data/ClassifierNames.dat", ',')
DatasetID = readdlm("Data/DatasetID.dat", ',');
DatasetNames = readdlm("Data/DatasetNames.dat", ',');
Percent_correct = readdlm("Data/Percent_correct.dat", ',');




ii=0
for cl1=1:Int32(maximum(ClassID))
    for cl2=cl1+1:Int32(maximum(ClassID))

        ii=ii+1
        indi=find(x->x==cl1,ClassID)
        indj=find(x->x==cl2,ClassID)
        acci=Float64[]
        accj=Float64[]
        for d=1:Int32(maximum(DatasetID))
            indd=find(x->x==d,DatasetID)
            indid=intersect(indi,indd)
            indjd=intersect(indj,indd)
            push!(acci,mean(Percent_correct[indid])/100)
            push!(accj,mean(Percent_correct[indjd])/100)
        end

        
     pvalSignedRankTest=pvalue(SignedRankTest(acci,accj))

     @printf "%s & %s & %1.3f \\\\\n" ClassNames[cl1] ClassNames[cl2] pvalSignedRankTest

    end
end


nbc & aode & 0.000 \\
nbc & hnb & 0.001 \\
nbc & j48 & 0.463 \\
nbc & j48gr & 0.394 \\
aode & hnb & 0.654 \\
aode & j48 & 0.077 \\
aode & j48gr & 0.106 \\
hnb & j48 & 0.067 \\
hn
LoadError: UndefVarError: tieadj not defined
while loading In[4], in expression starting on line 12

 in SignedRankTest at /home/benavoli/.julia/v0.4/HypothesisTests/src/wilcoxon.jl:33
 [inlined code] from In[4]:29
 in anonymous at no file:0
b & j48gr & 0.084 \\

In [1]:
using  Distributions
using DataFrames
using Gadfly
using Compose

include("Tests/Bsignranktest.jl")
include("Tests/Bsigntest.jl")
include("Plots/plot_simplex.jl")

ClassID = readdlm("Data/ClassifierID.dat", ',')
ClassNames = readdlm("Data/ClassifierNames.dat", ',')
DatasetID = readdlm("Data/DatasetID.dat", ',');
DatasetNames = readdlm("Data/DatasetNames.dat", ',');
Percent_correct = readdlm("Data/Percent_correct.dat", ',');


p1=Array{Gadfly.Plot}(Int32(maximum(ClassID)*(maximum(ClassID)-1)/2))
data=0

ii=0
for cl1=1:Int32(maximum(ClassID))
    for cl2=cl1+1:Int32(maximum(ClassID))

        ii=ii+1
indi=find(x->x==cl1,ClassID)
indj=find(x->x==cl2,ClassID)
acci=Float64[]
accj=Float64[]
for d=1:Int32(maximum(DatasetID))
    indd=find(x->x==d,DatasetID)
    indid=intersect(indi,indd)
    indjd=intersect(indj,indd)
    push!(acci,mean(Percent_correct[indid])/100)
    push!(accj,mean(Percent_correct[indjd])/100)
end
        rope=0.01
        #data=Bsigntest(acci,accj,rope)
        data=Bsignranktest(acci,accj,rope)
        #println(mean(data[3,:]), " ", mean(data[2,:]), " ",mean(data[1,:]))
        val=zeros(size(data,2),1)
        for ind=1:size(data,2)
            val[ind,:]=indmax(data[:,ind])
        end
        
        @printf "%s & %s & %1.3f & %1.3f & %1.3f \\\\\n" ClassNames[cl1] ClassNames[cl2] length(find(x->x==3,val))/length(val) length(find(x->x==2,val))/length(val)  length(find(x->x==1,val))/length(val)
        
ptriangle=plot_simplex(data, ClassNames[cl1],ClassNames[cl2])
p1[ii,:]=ptriangle
        
     #   pvalSignedRankTest=pvalue(SignedRankTest(acci,accj))

    # @printf "%s & %s & %1.3f \\\\\n" ClassNames[cl1] ClassNames[cl2] pvalSignedRankTest

    end
end

#set_default_plot_size(30cm, 40cm)
#display(vstack(hstack(p1[2,1],p1[3,1],p1[4,1]),
 #              hstack(p1[5,1],p1[6,1],p1[7,1]),
  #             hstack(p1[8,1],p1[9,1],p1[10,1])))

draw(PDF("Plots/plotmanytriangles.pdf", 30cm, 26cm),vstack(hstack(p1[2,1],p1[3,1],p1[4,1]),
               hstack(p1[5,1],p1[6,1],p1[7,1]),
               hstack(p1[8,1],p1[9,1],p1[10,1])))


nbc & aode & 0.000 & 0.123 & 0.877 \\
nbc & hnb & 0.000 & 0.001 & 0.999 \\
nbc & j48 & 0.228 & 0.006 & 0.766 \\
nbc & j48gr & 0.179 & 0.004 & 0.817 \\
aode & hnb & 0.001 & 0.965 & 0.034 \\
aode & j48 & 0.904 & 0.034 & 0.062 \\
aode & j48gr & 0.883 & 0.046 & 0.071 \\
hnb & j48 & 0.962 & 0.020 & 0.019 \\
hnb & j48gr & 0.950 & 0.026 & 0.024 \\
j48 & j48gr & 0.000 & 1.000 & 0.000 \\

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]: