source: orange/Orange/doc/reference/cb-mydomain.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 497 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1# Description: Shows an example of an Orange class that cannot be subtyped in Python
2# Category:    callbacks to Python
3# Classes:     Domain
4# Uses:        lenses
5# Referenced:  callbacks.htm
6
7import orange, orngTree, orngMisc
8tab = orange.ExampleTable(r"lenses.tab")
9
10
11class MyDomain(orange.Domain):
12    def __call__(self, ex):
13        ex2 = orange.Domain.__call__(self, ex)
14        ex2.setclass("?")
15        return ex2
16
17md = MyDomain(tab.domain)
18ce1 = orange.Example(md, tab[0])
19ce2 = md(tab[0])
20print ce1
21print ce2
Note: See TracBrowser for help on using the repository browser.