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

Class MockClassifier

tests/example_tests/multidimensional_data.py:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9class MockClassifier(BaseEstimator):
10 def __init__(self, n_classes=2):
11 self.n_classes = n_classes
12
13 def fit(self, X, y):
14 return self
15
16 def predict(self, X):
17 return np.random.randint(0, self.n_classes, shape=(len(X), 1))
18
19 def predict_proba(self, X):
20 return np.ones(shape=(len(X), self.n_classes))/self.n_classes
21
22
23if __name__ == '__main__':

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…