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

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

Move reliability regression tests to add-on.

Line 
1import Orange
2
3housing = Orange.data.Table("housing.tab")
4
5knn = Orange.classification.knn.kNNLearner()
6
7estimators = [Orange.evaluation.reliability.Mahalanobis(k=3),
8              Orange.evaluation.reliability.LocalCrossValidation(k = 10)]
9
10reliability = Orange.evaluation.reliability.Learner(knn, estimators = estimators)
11
12restimator = reliability(housing)
13instance = housing[0]
14
15value, probability = restimator(instance, result_type=Orange.classification.Classifier.GetBoth)
16
17for estimate in probability.reliability_estimate:
18    print estimate.method_name, estimate.estimate
Note: See TracBrowser for help on using the repository browser.