Changeset 3615:19e2d04c2dca in orange


Ignore:
Timestamp:
04/30/07 17:41:38 (7 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
54dd14527cd99a0b38749cb39ef295ceac2b2bcb
Message:
  • added ignoring of some warnings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Classify/OWNaiveBayes.py

    r3482 r3615  
    1010import OWGUI, orange 
    1111from exceptions import Exception 
     12 
     13import warnings 
     14warnings.filterwarnings("ignore", r"'BayesLearner': invalid conditional probability or no attributes \(the classifier will use apriori probabilities\)", orange.KernelWarning, ".*OWNaiveBayes", 136) 
     15warnings.filterwarnings("ignore", "'BayesLearner': threshold can only be optimized for binary classes", orange.KernelWarning, ".*OWNaiveBayes", 136) 
    1216 
    1317class OWNaiveBayes(OWWidget): 
     
    127131 
    128132    def applyData(self): 
     133        self.error(1) 
    129134        if self.data and self.learner: 
    130135            try: 
     
    132137                classifier.setattr("data", self.data) 
    133138                classifier.name = self.name 
    134                 self.error(1) 
    135139            except Exception, (errValue): 
    136140                classifier = None 
     
    154158                             self.mwidget.box.isEnabled and ("m for m-estimate", "%.1f" % self.m_estimator.m), 
    155159                             ("LOESS window size", "%.1f" % self.windowProportion), 
    156                              ("Number of points in LOESS", "%i" % self.loessPoints) 
     160                             ("Number of points in LOESS", "%i" % self.loessPoints), 
    157161                             ("Adjust classification threshold", OWGUI.YesNo[self.adjustThreshold]) 
    158162                            ]) 
Note: See TracChangeset for help on using the changeset viewer.