Exemple #1
0
    def testClassify(self):
        p = 0.1
        binomialClassifier = BinomialClassifier(p)
        y = binomialClassifier.classify(self.X)

        positives = float(sum(y == 1)) / self.X.shape[0]

        logging.debug(positives)

        self.assertAlmostEqual(p, positives, 1)
    def testClassify(self):
        p = 0.1
        binomialClassifier = BinomialClassifier(p)
        y = binomialClassifier.classify(self.X)

        positives = float(sum(y==1))/self.X.shape[0]
        
        logging.debug(positives)

        self.assertAlmostEqual(p, positives, 1)
Exemple #3
0
 def testLearnModel(self):
     p = 0.1
     binomialClassifier = BinomialClassifier(p)
     binomialClassifier.learnModel(self.X, self.y)
 def testLearnModel(self):
     p = 0.1 
     binomialClassifier = BinomialClassifier(p)
     binomialClassifier.learnModel(self.X, self.y)