def test_fit_reset(caplog): caplog.set_level(logging.DEBUG) node = Pipeline(steps=dummy_classifier, event_reset='reset') node._status = -1 # bypass accumulation node._X_train = np.array([-1, 1, 1, 1]) node._y_train = np.array([0, 1, 1, 1]) node.i_events.data = make_event('training_starts') node.update() node.i_events.data = make_event('reset') node.update() assert caplog.record_tuples[0][2] == 'Start training' assert caplog.record_tuples[1][2] == 'Reset' assert node._status == 0
def test_fit_success(caplog): caplog.set_level(logging.DEBUG) node = Pipeline(steps=dummy_classifier) node._status = -1 # bypass accumulation assert hasattr(node._pipeline[0], 'n_classes_') == False node._X_train = np.array([-1, 1, 1, 1]) node._y_train = np.array([0, 1, 1, 1]) node.i_events.data = make_event('training_starts') while node._status != 3: node.update() assert node._pipeline[0].n_classes_ == 2 assert caplog.record_tuples[0][2] == 'Start training' assert caplog.record_tuples[1][2].startswith('Model fitted in')