source: orange/docs/reference/rst/code/scoring-calls.py @ 9372:aef193695ea9

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

Moved documentation to the separate directory.

Line 
1# Description: Demonstation of different type of calls of the scoring method.
2# Category:    feature scoring
3# Uses:        titanic
4# Referenced:
5# Classes:
6
7import Orange
8table = Orange.data.Table("titanic")
9meas = Orange.feature.scoring.GainRatio()
10
11print "Call with variable and data table"
12print meas(0, table)
13
14print "Call with variable and domain contingency"
15domain_cont = Orange.statistics.contingency.Domain(table)
16print meas(0, domain_cont)
17
18print "Call with contingency and class distribution"
19cont = Orange.statistics.contingency.VarClass(0, table)
20class_dist = Orange.statistics.distribution.Distribution( \
21    table.domain.class_var, table)
22print meas(cont, class_dist)
Note: See TracBrowser for help on using the repository browser.