source: orange/docs/reference/rst/code/imputation-logreg.py @ 9810:a936f359ec27

Revision 9810:a936f359ec27, 738 bytes checked in by tomazc <tomaz.curk@…>, 2 years ago (diff)

Orange.feature.imputation

Line 
1# Description: Shows how to build a learner that imputes prior to learning.
2# Category:    imputation
3# Uses:        bridges
4# Referenced:  Orange.feature.html#imputation
5# Classes:     Orange.feature.imputation.ImputeLearner, Orange.feature.imputation.ImputerConstructor_minimal
6
7import Orange
8
9lr = Orange.classification.logreg.LogRegLearner()
10imputer = Orange.feature.imputation.ImputerConstructor_minimal
11
12imlr = Orange.feature.imputation.ImputeLearner(base_learner=lr,
13    imputer_constructor=imputer)
14
15voting = Orange.data.Table("voting")
16res = Orange.evaluation.testing.cross_validation([lr, imlr], voting)
17CAs = Orange.evaluation.scoring.CA(res)
18
19print "Without imputation: %5.3f" % CAs[0]
20print "With imputation: %5.3f" % CAs[1]
Note: See TracBrowser for help on using the repository browser.