@@ -779,6 +779,15 @@ class RidgeClassifier(LinearClassifierMixin, _BaseRidge):
779
779
Actual number of iterations for each target. Available only for
780
780
sag and lsqr solvers. Other solvers will return None.
781
781
782
+ Examples
783
+ --------
784
+ >>> from sklearn.datasets import load_breast_cancer
785
+ >>> from sklearn.linear_model import RidgeClassifier
786
+ >>> X, y = load_breast_cancer(return_X_y=True)
787
+ >>> clf = RidgeClassifier().fit(X, y)
788
+ >>> clf.score(X, y) # doctest: +ELLIPSIS
789
+ 0.9595...
790
+
782
791
See also
783
792
--------
784
793
Ridge : Ridge regression
@@ -1249,6 +1258,15 @@ class RidgeCV(_BaseRidgeCV, RegressorMixin):
1249
1258
alpha_ : float
1250
1259
Estimated regularization parameter.
1251
1260
1261
+ Examples
1262
+ --------
1263
+ >>> from sklearn.datasets import load_diabetes
1264
+ >>> from sklearn.linear_model import RidgeCV
1265
+ >>> X, y = load_diabetes(return_X_y=True)
1266
+ >>> clf = RidgeCV(alphas=[1e-3, 1e-2, 1e-1, 1]).fit(X, y)
1267
+ >>> clf.score(X, y) # doctest: +ELLIPSIS
1268
+ 0.5166...
1269
+
1252
1270
See also
1253
1271
--------
1254
1272
Ridge : Ridge regression
@@ -1339,6 +1357,15 @@ class RidgeClassifierCV(LinearClassifierMixin, _BaseRidgeCV):
1339
1357
alpha_ : float
1340
1358
Estimated regularization parameter
1341
1359
1360
+ Examples
1361
+ --------
1362
+ >>> from sklearn.datasets import load_breast_cancer
1363
+ >>> from sklearn.linear_model import RidgeClassifierCV
1364
+ >>> X, y = load_breast_cancer(return_X_y=True)
1365
+ >>> clf = RidgeClassifierCV(alphas=[1e-3, 1e-2, 1e-1, 1]).fit(X, y)
1366
+ >>> clf.score(X, y) # doctest: +ELLIPSIS
1367
+ 0.9630...
1368
+
1342
1369
See also
1343
1370
--------
1344
1371
Ridge : Ridge regression
0 commit comments