Changeset 4001:faf22fe51faa in orange


Ignore:
Timestamp:
07/19/07 15:52:36 (7 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
42832993ffdf922454250b1948bd502f50fc36f4
Message:
  • minor changes in the user interface
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Associate/OWAssociationRules.py

    r3498 r4001  
    1212 
    1313class OWAssociationRules(OWWidget): 
     14    settingsList = ["useSparseAlgorithm", "classificationRules", "minSupport", "minConfidence", "maxRules"] 
     15     
    1416    def __init__(self,parent=None, signalManager = None): 
    1517        OWWidget.__init__(self, parent, signalManager, "AssociationRules") 
     
    1719        self.inputs = [("Examples", ExampleTable, self.setData)] 
    1820        self.outputs = [("Association Rules", orange.AssociationRules)] 
    19  
    20         self.settingsList = ["useSparseAlgorithm", "classificationRules", "minSupport", "minConfidence", "maxRules"] 
    2121 
    2222        self.useSparseAlgorithm = 0 
     
    2929        self.dataset = None 
    3030 
    31         box = OWGUI.widgetBox(self.space, "Algorithm") 
     31        box = OWGUI.widgetBox(self.space, "Algorithm", addSpace = True) 
    3232        self.cbSparseAlgorithm = OWGUI.checkBox(box, self, 'useSparseAlgorithm', 'Use algorithm for sparse data', tooltip="Use original Agrawal's algorithm", callback = self.checkSparse) 
    3333        self.cbClassificationRules = OWGUI.checkBox(box, self, 'classificationRules', 'Induce classification rules', tooltip="Induce classifaction rules") 
    34         OWGUI.separator(self.space, 0, 8) 
     34        self.checkSparse() 
    3535 
    36         box = OWGUI.widgetBox(self.space, "Pruning") 
     36        box = OWGUI.widgetBox(self.space, "Pruning", addSpace = True) 
    3737        OWGUI.widgetLabel(box, "Minimal support [%]") 
    38         OWGUI.hSlider(box, self, 'minSupport', minValue=10, maxValue=100, ticks=10, step = 1) 
     38        OWGUI.hSlider(box, self, 'minSupport', minValue=1, maxValue=100, ticks=10, step = 1) 
    3939        OWGUI.separator(box, 0, 0) 
    4040        OWGUI.widgetLabel(box, 'Minimal confidence [%]') 
    41         OWGUI.hSlider(box, self, 'minConfidence', minValue=10, maxValue=100, ticks=10, step = 1) 
     41        OWGUI.hSlider(box, self, 'minConfidence', minValue=1, maxValue=100, ticks=10, step = 1) 
    4242        OWGUI.separator(box, 0, 0) 
    4343        OWGUI.widgetLabel(box, 'Maximal number of rules') 
    4444        OWGUI.hSlider(box, self, 'maxRules', minValue=10000, maxValue=100000, step=10000, ticks=10000, debuggingEnabled = 0) 
    45         OWGUI.separator(self.space, 0, 8) 
    4645 
    47         # Generate button 
    48         self.btnGenerate = QPushButton("&Build rules", self.space) 
    49         self.connect(self.btnGenerate,SIGNAL("clicked()"), self.generateRules) 
     46        OWGUI.button(self.space, self, "&Build rules", self.generateRules) 
    5047 
    51         self.resize(150,180) 
     48        self.adjustSize() 
    5249 
    5350 
     
    7269            self.send("Association Rules", None) 
    7370 
     71 
    7472    def checkSparse(self): 
    75         state = self.cbSparseAlgorithm.isChecked() 
    76         if state: 
    77             self.cbClassificationRules.setEnabled(0) 
     73        self.cbClassificationRules.setEnabled(not self.useSparseAlgorithm) 
     74        if self.useSparseAlgorithm: 
    7875            self.cbClassificationRules.setChecked(0) 
    79         else: 
    80             self.cbClassificationRules.setEnabled(1) 
     76 
    8177 
    8278    def setData(self,dataset): 
     
    8884    ow=OWAssociationRules() 
    8985    a.setMainWidget(ow) 
    90  
    9186##    data = orange.ExampleTable("car") 
    9287##    ow.setData(data) 
    93  
    9488    ow.show() 
    9589    a.exec_loop() 
Note: See TracChangeset for help on using the changeset viewer.