source: orange/docs/reference/rst/code/imputation-minimal-imputer.py @ 9372:aef193695ea9

Revision 9372:aef193695ea9, 703 bytes checked in by mitar, 2 years ago (diff)

Moved documentation to the separate directory.

Line 
1# Description: Shows how to impute missing values using the
2# Category:    imputation
3# Uses:        voting
4# Referenced:  Orange.feature.html#imputation
5# Classes:     Orange.feature.imputation.ImputeLearner, Orange.feature.imputation.ImputerConstructor_minimal
6
7import Orange
8
9ba = Orange.classification.bayes.NaiveLearner()
10imba = Orange.feature.imputation.ImputeLearner(base_learner=ba, 
11       imputer_constructor=Orange.feature.imputation.ImputerConstructor_minimal)
12
13table = Orange.data.Table("voting")
14res = Orange.evaluation.testing.cross_validation([ba, imba], table)
15CAs = Orange.evaluation.scoring.CA(res)
16
17print "Without imputation: %5.3f" % CAs[0]
18print "With imputation: %5.3f" % CAs[1]
Note: See TracBrowser for help on using the repository browser.