Upgrade to Python 3.13 (#11588)

This commit is contained in:
Christian Clauss
2024-09-30 23:01:15 +02:00
committed by GitHub
parent a7bfa22455
commit 0177ae1cd5
35 changed files with 135 additions and 131 deletions

View File

@ -45,7 +45,7 @@ def sigmoid_function(z: float | np.ndarray) -> float | np.ndarray:
@returns: returns value in the range 0 to 1
Examples:
>>> sigmoid_function(4)
>>> float(sigmoid_function(4))
0.9820137900379085
>>> sigmoid_function(np.array([-3, 3]))
array([0.04742587, 0.95257413])
@ -100,7 +100,7 @@ def cost_function(h: np.ndarray, y: np.ndarray) -> float:
References:
- https://en.wikipedia.org/wiki/Logistic_regression
"""
return (-y * np.log(h) - (1 - y) * np.log(1 - h)).mean()
return float((-y * np.log(h) - (1 - y) * np.log(1 - h)).mean())
def log_likelihood(x, y, weights):