Skip to content

Commit 93c7804

Browse files
committed
tests added for force_all_finite mode
1 parent fdd2aa7 commit 93c7804

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/core_tests.py

+19
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,25 @@ def test_teach(self):
734734

735735
learner.teach(X, y, bootstrap=bootstrap, only_new=only_new)
736736

737+
def test_nan(self):
738+
X_training_nan = np.ones(shape=(10, 2)) * np.nan
739+
X_training_inf = np.ones(shape=(10, 2)) * np.inf
740+
y_training = np.random.randint(0, 2, size=10)
741+
742+
learner = modAL.models.learners.ActiveLearner(
743+
X_training=X_training_nan, y_training=y_training,
744+
estimator=mock.MockEstimator(),
745+
force_all_finite=False
746+
)
747+
learner.teach(X_training_nan, y_training)
748+
749+
learner = modAL.models.learners.ActiveLearner(
750+
X_training=X_training_inf, y_training=y_training,
751+
estimator=mock.MockEstimator(),
752+
force_all_finite=False
753+
)
754+
learner.teach(X_training_inf, y_training)
755+
737756
def test_keras(self):
738757
pass
739758

0 commit comments

Comments
 (0)