source: orange/docs/reference/rst/code/imputation-minimal-imputer.py @ 9638:eb3af38491f2

Revision 9638:eb3af38491f2, 705 bytes checked in by umek@…, 2 years ago (diff)

Changed table to data or name of the data set.

For example - instead of

table = Orange.data.Table("housing")

is changed to

housing = Orange.data.Table("housing")

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
13voting = Orange.data.Table("voting")
14res = Orange.evaluation.testing.cross_validation([ba, imba], voting)
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.