Exemple #1
0
    def test_fit_gt_r_min(self, fit_mock):
        """If the length of X is greater than r_minimum, calculate POU."""
        # Set-up
        tuner = GPEiVelocity(tuple(), r_minimum=2)

        # Run
        X = np.array([[1., 1], [1.2, 2], [1.4, 3], [1.6, 4], [1.8, 5]])
        y = np.array([0.8, 0.81, 0.9, 0.84, 0.87])
        tuner.fit(X, y)

        # assert
        assert tuner.POU == 0.08208499862389883
Exemple #2
0
    def test_fit_lt_r_min(self, fit_mock):
        """If the length of X is smaller than r_minimum, nothing is done."""
        # Set-up
        tuner = GPEiVelocity(tuple(), r_minimum=5)

        # Run
        X = np.array([[1., 1], [1.2, 2], [1.4, 4]])
        y = np.array([0.5, 0.6, 0.7])
        tuner.fit(X, y)

        # assert
        assert tuner.POU == 0
Exemple #3
0
    def test_fit_lt_r_min(self, fit_mock):
        """If the length of X is smaller than r_minimum, nothing is done."""
        # Set-up
        tuner = GPEiVelocity(tuple(), r_minimum=5)

        # Run
        X = np.array([
            [1., 1],
            [1.2, 2],
            [1.4, 4]
        ])
        y = np.array([0.5, 0.6, 0.7])
        tuner.fit(X, y)

        # assert
        assert tuner.POU == 0
Exemple #4
0
    def test_fit_gt_r_min(self, fit_mock):
        """If the length of X is greater than r_minimum, calculate POU."""
        # Set-up
        tuner = GPEiVelocity(tuple(), r_minimum=2)

        # Run
        X = np.array([
            [1., 1],
            [1.2, 2],
            [1.4, 3],
            [1.6, 4],
            [1.8, 5]
        ])
        y = np.array([0.8, 0.81, 0.9, 0.84, 0.87])
        tuner.fit(X, y)

        # assert
        assert tuner.POU == 0.08208499862389883