[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-10-23 15:25:53 +00:00
parent 38764378d4
commit c76784e708

View File

@ -3,7 +3,8 @@ import pandas as pd
class RidgeRegression:
def __init__(self,
def __init__(
self,
alpha: float = 0.001,
regularization_param: float = 0.1,
num_iterations: int = 1000,
@ -49,8 +50,7 @@ class RidgeRegression:
m = len(y)
predictions = x_scaled.dot(self.theta)
cost = (
1 / (2 * m)) * np.sum((predictions - y) ** 2) + (
cost = (1 / (2 * m)) * np.sum((predictions - y) ** 2) + (
self.regularization_param / (2 * m)
) * np.sum(self.theta**2)
return cost