MCPcopy Create free account
hub / github.com/modAL-python/modAL / test_teach

Method test_teach

tests/core_tests.py:1469–1491  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1467 )
1468
1469 def test_teach(self):
1470 X_training = np.random.rand(10, 2)
1471 y_training = np.random.randint(0, 2, size=10)
1472
1473 for bootstrap, only_new in product([True, False], [True, False]):
1474 for n_samples in range(1, 10):
1475 X = np.random.rand(n_samples, 2)
1476 y = np.random.randint(0, 2, size=n_samples)
1477
1478 learner_1 = modAL.models.learners.ActiveLearner(
1479 X_training=X_training, y_training=y_training,
1480 estimator=mock.MockEstimator(classes_=[0, 1])
1481 )
1482 learner_2 = modAL.models.learners.ActiveLearner(
1483 X_training=X_training, y_training=y_training,
1484 estimator=mock.MockEstimator(classes_=[0, 1])
1485 )
1486
1487 committee = modAL.models.learners.Committee(
1488 learner_list=[learner_1, learner_2]
1489 )
1490
1491 committee.teach(X, y, bootstrap=bootstrap, only_new=only_new)
1492
1493 def test_on_transformed(self):
1494 n_samples = 10

Callers

nothing calls this directly

Calls 1

teachMethod · 0.95

Tested by

no test coverage detected