

def test_TrainRandomOneEpoch(self):
    for t in ['dok_matrix', 'lil_matrix']:
        sparse_matrix = getattr(scipy.sparse, t)
        (X_s, y_s) = (sparse_matrix((8, 16), dtype=numpy.float32), sparse_matrix((8, 16), dtype=numpy.float32))
        for i in range(X_s.shape[0]):
            X_s[(i, random.randint(0, (X_s.shape[1] - 1)))] = 1.0
            y_s[(i, random.randint(0, (y_s.shape[1] - 1)))] = 1.0
        (X, y) = (X_s.toarray(), y_s.toarray())
        nn1 = MLP(layers=[L('Linear')], n_iter=1, random_state=1234)
        nn1._fit(y, y)
        nn2 = MLP(layers=[L('Linear')], n_iter=1, random_state=1234)
        nn2._fit(X_s, y_s)
        assert_true(numpy.all((nn1._predict(X_s) == nn1._predict(X_s))))

dataset/ETHPy150Open aigamedev/scikit-neuralnetwork/sknn/tests/test_types.py TestFormatDeterminism.test_TrainRandomOneEpoch/VarMisuse@186/239 `X`->`y`