source: orange/orange/doc/Orange/rst/code/imputation-minimal-imputer.py @ 7764:773887c2a6e2

Revision 7764:773887c2a6e2, 703 bytes checked in by markotoplak, 3 years ago (diff)

Imputation for 2.5.

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.