示例#1
0
        plt.xlabel("False Positive Rate")
        plt.ylabel("True Positive Rate")
        plt.savefig(figureDir + labelName.replace(".", "_") + "-ROC.eps")
        
    plotInd += 1 


#The last column is the mean value
meanMeanAUCs = numpy.mean(meanAUCs, 1)
meanStdAUCs = numpy.mean(stdAUCs, 1)
meanAUCs = numpy.c_[meanAUCs, meanMeanAUCs]
stdAUCs = numpy.c_[stdAUCs, meanStdAUCs]

print("\n")
print(Latex.listToRow(labelNames))
print(Latex.addRowNames(rowNames, Latex.array2DsToRows(meanAUCs, stdAUCs, 2)))


#----------------- Results for RankBoost and RankSVM  ----------------------------------

algorithmNames = ["RankBoost", "RankSVM"]
numMethods = len(dataTypes)*len(algorithmNames)
rowNames = numpy.zeros(numMethods, "a20")
meanAUCs = numpy.zeros((numMethods, len(labelNames)))
stdAUCs = numpy.zeros((numMethods, len(labelNames)))

for m in range(len(algorithmNames)):
    algorithmName = algorithmNames[m]

    for i in range(len(labelNames)):
        labelName = labelNames[i]
                meanTotalInfo = numpy.mean(totalInfo, 0)/numVertices
                stdTotalInfo = numpy.std(totalInfo, 0)/numVertices
                meanAverageHops = numpy.mean(averageHops)
                stdAverageHops = numpy.std(averageHops)

                meanTotalInfo = meanTotalInfo.ravel()
                stdTotalInfo = stdTotalInfo.ravel()
                meanTotalInfo = meanTotalInfo[1:maxIters]-meanTotalInfo[0:maxIters-1]
                stdTotalInfo = stdTotalInfo[0:maxIters-1]+stdTotalInfo[1:maxIters]
                if infoProb == 0.5:
                    pyplot.plot(meanTotalInfo.ravel(), label= "p="+str(p)+",k="+str(k))

                print((str(p) + " & " + str(k) + " & " + str(infoProb) + " & %.3f" % meanAverageHops), end=' ')
                print(("(%.3f) & " % stdAverageHops), end=' ')
                print(("%.3f (%.3f) & " % (meanReceiversToSenders, stdReceiversToSenders)), end=' ')
                print((Latex.array2DsToRows(meanTotalInfo.ravel()[0:maxIters], stdTotalInfo.ravel()[0:maxIters]) + "\\\\"))
            except IOError:
                print(("File not found : " + outputFileName))

pyplot.xlabel('Total information')
pyplot.ylabel('Iteration')
pyplot.legend(loc=10, ncol=3, shadow=True)

#pyplot.show()

print("")
print("")

graphType = "ErdosRenyi"
ps = [0.001, 0.002, 0.003, 0.004]