MCPcopy
hub / github.com/ddbourgin/numpy-ml / ClassProbEstimator

Class ClassProbEstimator

numpy_ml/trees/losses.py:8–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class ClassProbEstimator:
9 def fit(self, X, y):
10 self.class_prob = y.sum() / len(y)
11
12 def predict(self, X):
13 pred = np.empty(X.shape[0], dtype=np.float64)
14 pred.fill(self.class_prob)
15 return pred
16
17
18class MeanBaseEstimator:

Callers 1

base_estimatorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected