source: orange-reliability/docs/rst/code/reliability-run.py @ 2:e96a42ae4a8f

Revision 2:e96a42ae4a8f, 802 bytes checked in by Matija Polajnar <matija.polajnar@…>, 2 years ago (diff)

Move reliability regression tests to add-on.

Line 
1# Description: Reliability estimation with cross-validation
2# Category:    evaluation
3# Uses:        housing
4# Referenced:  Orange.evaluation.reliability
5# Classes:     Orange.evaluation.reliability.Learner
6
7import Orange
8Orange.evaluation.reliability.select_with_repeat.random_generator = None
9Orange.evaluation.reliability.select_with_repeat.randseed = 42
10
11import Orange
12housing = Orange.data.Table("housing.tab")
13
14knn = Orange.classification.knn.kNNLearner()
15reliability = Orange.evaluation.reliability.Learner(knn)
16
17results = Orange.evaluation.testing.cross_validation([reliability], housing)
18
19for i, instance in enumerate(results.results[:10]):
20    print "Instance", i
21    for estimate in instance.probabilities[0].reliability_estimate:
22        print "  ", estimate.method_name, estimate.estimate
Note: See TracBrowser for help on using the repository browser.