MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / __call__

Method __call__

numpy_ml/trees/losses.py:53–55  ·  view source on GitHub ↗
(self, y, y_pred)

Source from the content-addressed store, hash-verified

51
52class CrossEntropyLoss:
53 def __call__(self, y, y_pred):
54 eps = np.finfo(float).eps
55 return -np.sum(y * np.log(y_pred + eps))
56
57 def base_estimator(self):
58 return ClassProbEstimator()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected