python实现CD图的绘制
直接上代码,如下:
import Orange
# import matplotlib
# matplotlib.use('TkAgg') # 不显示图则加上这两行
import matplotlib.pyplot as plt
names = ['alg1', 'alg2', 'alg3', 'alg4', 'alg5', 'alg6', 'alg7']
avranks = [5.9, 4.37, 4.25, 5.39, 2.19, 2.85, 3.04]
datasets_num = 135
CD = Orange.evaluation.scoring.compute_CD(avranks, datasets_num, alpha='0.05', test='nemenyi')
Orange.evaluation.scoring.graph_ranks(avranks, names, cd=CD, width=8, textspace=1.5, reverse=True)
plt.show()
运行得到的临界图如下
关于Orange.evaluation.scoring.graph_ranks( ) 的其它参数具体用法如下:
详见Orange文档
文章出处登录后可见!
已经登录?立即刷新