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

Class MockActiveLearner

tests/mock.py:51–78  ·  view source on GitHub ↗

Mock ActiveLearner for testing.

Source from the content-addressed store, hash-verified

49
50
51class MockActiveLearner:
52 """
53 Mock ActiveLearner for testing.
54 """
55 def __init__(
56 self, predictor=None, query_strategy=None,
57 predict_proba_return=None, calculate_utility_return=None, predict_return=None, score_return=None,
58 _X_initial=None, _y_initial=None
59 ):
60 self.estimator = predictor
61 self.query_strategy = query_strategy
62
63 self.predict_proba_return = predict_proba_return
64 self.calculate_utility_return = calculate_utility_return
65 self.predict_return = predict_return
66 self.score_return = score_return
67
68 def fit(self, *args, **kwargs):
69 pass
70
71 def predict(self, *args, **kwargs):
72 return self.predict_return
73
74 def predict_proba(self, *args, **kwargs):
75 return self.predict_proba_return
76
77 def score(self, *args, **kwargs):
78 return self.score_return
79
80
81class MockCommittee:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…