mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-12 09:39:49 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
e9ef03eadb
commit
861618ef11
@ -3,7 +3,9 @@ import pandas as pd
|
|||||||
|
|
||||||
|
|
||||||
class RidgeRegression:
|
class RidgeRegression:
|
||||||
def __init__(self, alpha: float = 0.001, lambda_: float = 0.1, iterations: int = 1000) -> None:
|
def __init__(
|
||||||
|
self, alpha: float = 0.001, lambda_: float = 0.1, iterations: int = 1000
|
||||||
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Ridge Regression Constructor
|
Ridge Regression Constructor
|
||||||
:param alpha: Learning rate for gradient descent
|
:param alpha: Learning rate for gradient descent
|
||||||
@ -15,7 +17,9 @@ class RidgeRegression:
|
|||||||
self.iterations = iterations
|
self.iterations = iterations
|
||||||
self.theta = None
|
self.theta = None
|
||||||
|
|
||||||
def feature_scaling(self, features: np.ndarray) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
|
def feature_scaling(
|
||||||
|
self, features: np.ndarray
|
||||||
|
) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
|
||||||
"""
|
"""
|
||||||
Normalize features to have mean 0 and standard deviation 1.
|
Normalize features to have mean 0 and standard deviation 1.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user