Skip to content

Commit 1ff1267

Browse files
committed
modify doc
1 parent 604bd69 commit 1ff1267

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

rehline/_path_sol.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,36 @@ def CQR_Ridge_path_sol(
298298
299299
fit_times : list of float, optional
300300
Elapsed fit times (if `return_time=True`).
301+
302+
303+
Example
304+
-------
305+
>>> from sklearn.datasets import make_friedman1
306+
>>> from sklearn.preprocessing import StandardScaler
307+
>>> import numpy as np
308+
>>> from rehline import CQR_Ridge_path_sol
309+
310+
>>> # Generate the data
311+
>>> X, y = make_friedman1(n_samples=500, n_features=6, noise=1.0, random_state=42)
312+
>>> X = StandardScaler().fit_transform(X)
313+
>>> y = y / y.std()
314+
315+
>>> # Set quantiles and Cs
316+
>>> quantiles = [0.1, 0.5, 0.9]
317+
>>> Cs = np.logspace(-5, 0, 30)
318+
319+
>>> # Fit CQR path
320+
>>> Cs, models, coefs, intercepts, fit_times = CQR_Ridge_path_sol(
321+
... X, y,
322+
... quantiles=quantiles,
323+
... Cs=Cs,
324+
... max_iter=100000,
325+
... tol=1e-4,
326+
... verbose=1,
327+
... warm_start=True,
328+
... return_time=True
329+
... )
330+
301331
"""
302332

303333
if Cs is None:

0 commit comments

Comments
 (0)