📄 cb-mydomain.py
字号:
# Description: Shows an example of an Orange class that cannot be subtyped in Python
# Category: callbacks to Python
# Classes: Domain
# Uses: lenses
# Referenced: callbacks.htm
import orange, orngTree, orngMisc
tab = orange.ExampleTable(r"lenses.tab")
class MyDomain(orange.Domain):
def __call__(self, ex):
ex2 = orange.Domain.__call__(self, ex)
ex2.setclass("?")
return ex2
md = MyDomain(tab.domain)
ce1 = orange.Example(md, tab[0])
ce2 = md(tab[0])
print ce1
print ce2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -