r - How can I generate CDdiagrams using Python/rpy2 -
i want generate graph similar this:
i know api can generate similar diagram, doesn't use matrix or vectors, object same r package.
https://cran.r-project.org/web/packages/performanceestimation/performanceestimation.pdf
## not run: ## estimating mse 3 variants of both ## regression trees , svms, on 2 data sets, using 1 repetition ## of 10-fold cv library(e1071) data(iris) data(satellite,package="mlbench") data(letterrecognition,package="mlbench") ## running estimation experiment res <- performanceestimation( c(predtask(species ~ .,iris), predtask(classes ~ .,satellite,"sat"), predtask(lettr ~ .,letterrecognition,"letter")), workflowvariants(learner="svm", learner.pars=list(cost=1:4,gamma=c(0.1,0.01))), estimationtask(metrics=c("err","acc"),method=cv())) ## checking top performers topperformers(res) ## let assume choose "svm.v2" our baseline ## carry out paired comparisons pres <- pairedcomparisons(res,"svm.v2") ## obtaining cd diagram comparing workflows against ## baseline (defined in previous call pairedcomparisons) cddiagram.bd(pres,metric="err") ## or nemenyi test cddiagram.nemenyi(pres,metric="err")
using orange (http://docs.orange.biolab.si/3/modules/evaluation.cd.html)
import orange, orngstat names = lbs # labels of each technique avranks = means # average ranking of each technique number_of_datasets = 30 # number of datasets # alpha = '0.1', '0.05' or '0.01' cd = orngstat.compute_cd(avranks, number_of_datasets, alpha='0.1') orngstat.graph_ranks("output.png", avranks, names, \ cd=cd, width=6, textspace=1.5) print cd plt.show()
Comments
Post a Comment