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)