MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / log_likelihood

Function log_likelihood

machine_learning/logistic_regression.py:106–108  ·  view source on GitHub ↗
(x, y, weights)

Source from the content-addressed store, hash-verified

104
105
106def log_likelihood(x, y, weights):
107 scores = np.dot(x, weights)
108 return np.sum(y * scores - np.log(1 + np.exp(scores)))
109
110
111# here alpha is the learning rate, X is the feature matrix,y is the target matrix

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected