Exemple #1
0
 def test_with_X_nan(self, boston_X, boston_y):
     boston_X_nan = boston_X.copy()
     index = np.random.choice(boston_X_nan.size, 100, replace=False)
     boston_X_nan.ravel()[index] = np.nan
     assert np.sum(np.isnan(boston_X_nan)) == 100
     tree = GRFTreeRegressor()
     tree.fit(boston_X_nan, boston_y)
     pred = tree.predict(boston_X_nan)
     assert len(pred) == boston_X_nan.shape[0]
Exemple #2
0
 def test_predict(self, boston_X, boston_y):
     tree = GRFTreeRegressor()
     tree.fit(boston_X, boston_y)
     pred = tree.predict(boston_X)
     assert len(pred) == boston_X.shape[0]