source: orange/orange/doc/Orange/rst/code/imputation-minimal-imputer.py @ 7568:b971bcbf4080

Revision 7568:b971bcbf4080, 699 bytes checked in by tomazc <tomaz.curk@…>, 3 years ago (diff)

Documentatio and code refactoring at Bohinj retreat.

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(baseLearner=ba, 
11       imputerConstructor=Orange.feature.imputation.ImputerConstructor_minimal)
12
13table = Orange.data.Table("voting")
14res = Orange.evaluation.testing.crossValidation([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.