@@ -583,6 +583,17 @@ class OrthogonalMatchingPursuit(LinearModel, RegressorMixin):
583583 n_iter_ : int or array-like
584584 Number of active features across every target.
585585
586+ Examples
587+ --------
588+ >>> from sklearn.linear_model import OrthogonalMatchingPursuit
589+ >>> from sklearn.datasets import make_regression
590+ >>> X, y = make_regression(noise=4, random_state=0)
591+ >>> reg = OrthogonalMatchingPursuit().fit(X, y)
592+ >>> reg.score(X, y) # doctest: +ELLIPSIS
593+ 0.9991...
594+ >>> reg.predict(X[:1,])
595+ array([-78.3854...])
596+
586597 Notes
587598 -----
588599 Orthogonal matching pursuit was introduced in G. Mallat, Z. Zhang,
@@ -814,6 +825,20 @@ class OrthogonalMatchingPursuitCV(LinearModel, RegressorMixin):
814825 Number of active features across every target for the model refit with
815826 the best hyperparameters got by cross-validating across all folds.
816827
828+ Examples
829+ --------
830+ >>> from sklearn.linear_model import OrthogonalMatchingPursuitCV
831+ >>> from sklearn.datasets import make_regression
832+ >>> X, y = make_regression(n_features=100, n_informative=10,
833+ ... noise=4, random_state=0)
834+ >>> reg = OrthogonalMatchingPursuitCV(cv=5).fit(X, y)
835+ >>> reg.score(X, y) # doctest: +ELLIPSIS
836+ 0.9991...
837+ >>> reg.n_nonzero_coefs_
838+ 10
839+ >>> reg.predict(X[:1,])
840+ array([-78.3854...])
841+
817842 See also
818843 --------
819844 orthogonal_mp
0 commit comments