From d8e2f894e2607ccec623333e3a25664af832d69f Mon Sep 17 00:00:00 2001 From: Nathan Date: Mon, 13 Oct 2025 15:43:10 -0400 Subject: [PATCH] changed penalty='none' to penalty=None, removed normalize = True from Ridge regression parameter (normalize parameter deprecated in newer version of scikit-learn --- .../week3/Optional Labs/plt_overfit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C1 - Supervised Machine Learning - Regression and Classification/week3/Optional Labs/plt_overfit.py b/C1 - Supervised Machine Learning - Regression and Classification/week3/Optional Labs/plt_overfit.py index 51d7e170..faa8cacf 100644 --- a/C1 - Supervised Machine Learning - Regression and Classification/week3/Optional Labs/plt_overfit.py +++ b/C1 - Supervised Machine Learning - Regression and Classification/week3/Optional Labs/plt_overfit.py @@ -333,7 +333,7 @@ def linear_regression(self): self.X_mapped_scaled, self.X_mu, self.X_sigma = zscore_normalize_features(self.X_mapped) #linear_model = LinearRegression() - linear_model = Ridge(alpha=self.lambda_, normalize=True, max_iter=10000) + linear_model = Ridge(alpha=self.lambda_, max_iter=10000) linear_model.fit(self.X_mapped_scaled, self.y ) self.w = linear_model.coef_.reshape(-1,) self.b = linear_model.intercept_ @@ -356,7 +356,7 @@ def logistic_regression(self): self.X_mapped, _ = map_feature(self.X[:, 0], self.X[:, 1], self.degree) self.X_mapped_scaled, self.X_mu, self.X_sigma = zscore_normalize_features(self.X_mapped) if not self.regularize or self.lambda_ == 0: - lr = LogisticRegression(penalty='none', max_iter=10000) + lr = LogisticRegression(penalty=None, max_iter=10000) else: C = 1/self.lambda_ lr = LogisticRegression(C=C, max_iter=10000)