Ejemplo n.º 1
0
    def test_n_steps_scoring(self):
        """ Test n steps scoring """
        X = np.array([[1, 2, 3, 4], [5, 6, 7, 8], [6, 9, 1, 9]])
        df = pd.DataFrame(X, index=np.arange(3),
                          columns=['l1_a', 'l1_b', 'a', 'b'])

        names = ['a', 'b']
        train = np.array([0])
        test = np.array([1, 2])

        gmrf_stub = GMRFStub(df.columns.values)
        scores = scoring(df, gmrf_stub, names, train, test)[1]

        assert_allclose(scores, np.array([[7, 6.5], [19, 15]]))