本文整理汇总了Python中Orange.OrangeWidgets.OWGUI.connectControl方法的典型用法代码示例。如果您正苦于以下问题:Python OWGUI.connectControl方法的具体用法?Python OWGUI.connectControl怎么用?Python OWGUI.connectControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orange.OrangeWidgets.OWGUI
的用法示例。
在下文中一共展示了OWGUI.connectControl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Orange.OrangeWidgets import OWGUI [as 别名]
# 或者: from Orange.OrangeWidgets.OWGUI import connectControl [as 别名]
def __init__(self, parent=None, signalManager = None):
OWWidget.__init__(self, parent, signalManager, 'ANOVA')
# input / output data: [("name1", [orange.ExampleTable1a,...]), ("name2", [orange.ExampleTable2a,...])]
self.inputs = [("Structured Data", DataFiles, self.onDataInput)]
self.outputs = [("Example Selection", ExampleSelection, Default), ("Selected Structured Data", DataFiles, Default), ("Other Structured Data", DataFiles)]
# data, p-values, selected examples
self.dataStructure = None # input data
self.numExamples = 0
self.numVariables = 0
self.ps = Numeric.ones((3,0), Numeric.Float) # p-values: 2D Numeric.array of shape (3, numExamples)
self.selectorName = "" # for Example Selection output: (self.selectorName, [0,1,0,...])
# Settings
self.anovaType = OWHypTest.StSST
self.popMean = 0 # single sample t-test, value to compare to
self.useFactors = [0,0,0] # [use factor A, use factor B, use interaction]
self._interaction = 0 # to store last setting: 0: no interaction, 1: test for interaction effect (set this value manually !!!)
self.selectorA = True
self.selectorB = False
self.selectorI = False
self.alphaA = "0.05"
self.alphaB = "0.05"
self.alphaI = "0.05"
self.autoUpdateSelName = 1
self.sendNotSelectedData = 1
self.sendProbabilities = 0
self.commitOnChange = 0
self.loadSettings()
# GUI
self.mainArea.setFixedWidth(0)
ca=QFrame(self.controlArea)
gl=QGridLayout(ca,4,1,5)
# info
box = QVGroupBox("Info", ca)
gl.addWidget(box,0,0)
self.infoa = QLabel('No data on input.', box)
self.infob = QLabel('', box)
self.infoc = QLabel('', box)
# ANOVA type
self.boxAnovaType = QVButtonGroup("Statistics", ca)
gl.addWidget(self.boxAnovaType,1,0)
self.boxAnovaType.setDisabled(1)
self.boxAnovaType.setRadioButtonExclusive(1)
self.boxAnovaType.buttons = []
## for i,lbl in enumerate(OWHypTest.StNames):
## w = QRadioButton(lbl, self.boxAnovaType)
## w.setOn(self.anovaType == i)
## self.boxAnovaType.buttons.append(w)
## if i == OWHypTest.StSST:
## self.boxPopMean = QHBox(self.boxAnovaType)
## QLabel(" population mean ", self.boxPopMean)
## OWGUI.lineEdit(self.boxPopMean, self, "popMean", callback=self.onPopMeanChange)
for i,lbl in enumerate(OWHypTest.StNames):
w = QRadioButton(lbl, self.boxAnovaType)
w.setOn(self.anovaType == i)
self.boxAnovaType.buttons.append(w)
if i == OWHypTest.StSST:
self.boxPopMean = QHBox(self.boxAnovaType)
QLabel(" population mean ", self.boxPopMean)
OWGUI.lineEdit(self.boxPopMean, self, "popMean", callback=self.onPopMeanChange)
OWGUI.connectControl(self.boxAnovaType, self, "anovaType", self.onAnovaType, "clicked(int)", OWGUI.CallFront_radioButtons(self.boxAnovaType))
# selection of examples
self.boxSelection = QVGroupBox("Example Selection", ca)
gl.addWidget(self.boxSelection,2,0)
self.lblNumGenes = [] # list of labels
# selector A
self.boxSelectorA = QVBox(self.boxSelection)
self.cbSelectorA = OWGUI.checkBox(self.boxSelectorA, self, "selectorA", "Factor A (variables)", callback=self.onSelectionChange,
tooltip='H0: The mean does not depend on factor A (represented by variables).')
frmA = QFrame(self.boxSelectorA)
glA = QGridLayout(frmA,1,3,5)
leA = OWGUI.lineEdit(frmA, self, "alphaA", orientation="horizontal", controlWidth=None, callback=lambda x=0: self.onAlphaChange(x))
glA.addWidget(leA,0,1) # Qt.AlignRight
glA.addWidget(QLabel(" p <= ", frmA), 0,0)
self.lblNumGenes.append(QLabel('', frmA))
glA.addWidget(self.lblNumGenes[-1],0,2) # Qt.AlignRight | 0x22
# selector B
self.boxSelectorB = QVBox(self.boxSelection)
self.cbSelectorB = OWGUI.checkBox(self.boxSelectorB, self, "selectorB", "Factor B (data sets)", callback=self.onSelectionChange,
tooltip='H0: The mean does not depend on factor B (represented by data sets).')
frmB = QFrame(self.boxSelectorB)
glB = QGridLayout(frmB,1,3,5)
leB = OWGUI.lineEdit(frmB, self, "alphaB", orientation="horizontal", callback=lambda x=1: self.onAlphaChange(x))
glB.addWidget(leB,0,1)
glB.addWidget(QLabel(" p <= ", frmB), 0,0)
self.lblNumGenes.append(QLabel('', frmB))
glB.addWidget(self.lblNumGenes[-1],0,2)
# selector I
self.boxSelectorI = QVBox(self.boxSelection)
self.cbSelectorI = OWGUI.checkBox(self.boxSelectorI, self, "selectorI", "Interaction (variables * data sets)", callback=self.onSelectionChange,
tooltip='H0: There is no interaction between factor A and factor B.')
frmI = QFrame(self.boxSelectorI)
#.........这里部分代码省略.........