예제 #1
0
    def test_reliability_diagram(self):
        probs = np.array([[0.42610548, 0.41748077, 0.15641374, 0],
                          [0.44766216, 0.47721294, 0.0751249, 0],
                          [0.1862702, 0.15139402, 0.66233578, 0],
                          [0.05753544, 0.8561222, 0.08634236, 0],
                          [0.18697925, 0.29836466, 0.51465609, 0]])

        labels = np.array([0, 1, 2, 1, 2])
        rd = um.reliability_diagram(labels, probs)
        self.assertGreater(rd.get_figwidth(), 1)
예제 #2
0
 def test_binary_2d(self):
     probs = np.array([np.random.rand()
                       for _ in range(10000)]).reshape(10000, 1)
     labels = np.array([np.random.binomial(1, p=p) for p in probs])
     rd = um.reliability_diagram(labels, probs)
     self.assertGreater(rd.get_figwidth(), 1)