source: orange/docs/reference/rst/code/mlc-evaluate.py @ 9823:7f9c3f3c6474

Revision 9823:7f9c3f3c6474, 875 bytes checked in by lanumek, 2 years ago (diff)

Changed names of data sets (table replaced with data or name of the data set).

Line 
1import Orange
2
3def print_results(res):
4    loss = Orange.evaluation.scoring.mlc_hamming_loss(res)
5    accuracy = Orange.evaluation.scoring.mlc_accuracy(res)
6    precision = Orange.evaluation.scoring.mlc_precision(res)
7    recall = Orange.evaluation.scoring.mlc_recall(res)
8    print 'loss=', loss
9    print 'accuracy=', accuracy
10    print 'precision=', precision
11    print 'recall=', recall
12    print
13
14learners = [Orange.multilabel.MLkNNLearner(k=5)]
15emotions = Orange.data.Table("emotions.tab")
16
17res = Orange.evaluation.testing.cross_validation(learners, emotions)
18print_results(res)
19
20res = Orange.evaluation.testing.leave_one_out(learners, emotions)
21print_results(res)
22
23res = Orange.evaluation.testing.proportion_test(learners, emotions, 0.5)
24print_results(res)
25
26reses = Orange.evaluation.testing.learning_curve(learners, emotions)
27for res in reses:
28    print_results(res)
Note: See TracBrowser for help on using the repository browser.