Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)

src/b/i/biopython-1.63/Tests/test_LogisticRegression.py   biopython(Download)
    def test_classify(self):
        model = LogisticRegression.train(xs, ys)
        result = LogisticRegression.classify(model, [6, -173.143442352])
        self.assertEqual(result, 1)
        result = LogisticRegression.classify(model, [309, -271.005880394])
        predictions = [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]
        for i in range(len(predictions)):
            prediction = LogisticRegression.classify(model, xs[i])
            self.assertEqual(prediction, predictions[i])
            if prediction==ys[i]:
        for i in range(len(predictions)):
            model = LogisticRegression.train(xs[:i]+xs[i+1:], ys[:i]+ys[i+1:])
            prediction = LogisticRegression.classify(model, xs[i])
            self.assertEqual(prediction, predictions[i])
            if prediction==ys[i]:

src/b/i/biopython-HEAD/Tests/test_LogisticRegression.py   biopython(Download)
    def test_classify(self):
        model = LogisticRegression.train(xs, ys)
        result = LogisticRegression.classify(model, [6, -173.143442352])
        self.assertEqual(result, 1)
        result = LogisticRegression.classify(model, [309, -271.005880394])
        predictions = [1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]
        for i in range(len(predictions)):
            prediction = LogisticRegression.classify(model, xs[i])
            self.assertEqual(prediction, predictions[i])
            if prediction==ys[i]:
        for i in range(len(predictions)):
            model = LogisticRegression.train(xs[:i]+xs[i+1:], ys[:i]+ys[i+1:])
            prediction = LogisticRegression.classify(model, xs[i])
            self.assertEqual(prediction, predictions[i])
            if prediction==ys[i]: