Skip to content

Commit

Permalink
FIX: parameter order in docstrings (#42)
Browse files Browse the repository at this point in the history
* Fix docstrings
  • Loading branch information
mathurinm committed Jul 23, 2018
1 parent b88e676 commit bf63a0d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
34 changes: 24 additions & 10 deletions celer/dropin_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ class Lasso(Lasso_sklearn):
p0 : int
First working set size.
verbose : bool or integer
Amount of verbosity.
tol : float, optional
The tolerance for the optimization: the solver runs until the duality
gap is smaller than ``tol`` or the maximum number of iteration is
reached.
verbose : bool or integer
Amount of verbosity.
prune : 0 | 1, optional
Whether or not to use pruning when growing working sets.
fit_intercept : bool, optional, default True
fit_intercept : bool, optional (default=True)
Whether or not to fit an intercept.
normalize : bool, optional, default False
normalize : bool, optional (default=False)
This parameter is ignored when ``fit_intercept`` is set to False.
If True, the regressors X will be normalized before regression by
subtracting the mean and dividing by the l2-norm.
Expand Down Expand Up @@ -117,7 +117,7 @@ class Lasso(Lasso_sklearn):

def __init__(self, alpha=1., max_iter=100, gap_freq=10,
max_epochs=50000, p0=10, verbose=0, tol=1e-4, prune=0,
fit_intercept=True, normalize=True):
fit_intercept=True, normalize=False):
super(Lasso, self).__init__(
alpha=alpha, tol=tol, max_iter=max_iter,
fit_intercept=fit_intercept, normalize=normalize)
Expand Down Expand Up @@ -166,7 +166,7 @@ class LassoCV(LassoCV_sklearn):
to false, no intercept will be used in calculations
(e.g. data is expected to be already centered).
normalize : bool, optional, default False
normalize : bool, optional (default=False)
This parameter is ignored when ``fit_intercept`` is set to False.
If True, the regressors X will be normalized before regression by
subtracting the mean and dividing by the l2-norm.
Expand All @@ -191,6 +191,21 @@ class LassoCV(LassoCV_sklearn):
verbose : bool or integer
Amount of verbosity.
gap_freq : int, optional (default=10)
In the inner loop, the duality gap is computed every `gap_freq`
coordinate descent epochs.
max_epochs : int, optional (default=50000)
Maximum number of coordinate descent epochs when solving a subproblem.
p0 : int, optional (default=10)
Number of features in the first working set.
prune : bool, optional (default=False)
Whether to use pruning when growing the working sets.
precompute : ignored parameter, kept for sklearn compatibility.
Attributes
----------
alpha_ : float
Expand Down Expand Up @@ -223,10 +238,9 @@ class LassoCV(LassoCV_sklearn):
"""

def __init__(self, eps=1e-3, n_alphas=100, alphas=None,
fit_intercept=True, max_iter=100,
fit_intercept=True, normalize=False, max_iter=100,
tol=1e-4, cv=None, verbose=0, gap_freq=10,
max_epochs=50000, p0=10, prune=0,
normalize=False, precompute='auto'):
max_epochs=50000, p0=10, prune=0, precompute='auto'):
super(LassoCV, self).__init__(
eps=eps, n_alphas=n_alphas, alphas=alphas, max_iter=max_iter,
tol=tol, cv=cv, fit_intercept=fit_intercept, normalize=normalize,
Expand Down
7 changes: 7 additions & 0 deletions celer/homotopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ def celer_path(X, y, eps=1e-3, n_alphas=100, alphas=None,
List of alphas where to compute the models.
If ``None`` alphas are set automatically
coef_init : ndarray, shape (n_features,) | None, optional, (defualt=None)
Initial value of coefficients. If None, np.zeros(n_features) is used.
max_iter : int, optional
The maximum number of iterations (subproblem definitions)
Expand Down Expand Up @@ -72,6 +75,10 @@ def celer_path(X, y, eps=1e-3, n_alphas=100, alphas=None,
return_thetas : bool, optional
If True, dual variables along the path are returned.
monitor : bool, optional (default=False)
Whether to return timings and gaps for each alpha. Used only for single
alpha.
X_offset : np.array, shape (n_features,), optional
Used to center sparse X without breaking sparsity. Mean of each column.
See sklearn.linear_model.base._preprocess_data().
Expand Down
6 changes: 3 additions & 3 deletions celer/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def celer(X, y, alpha, w_init=None, max_iter=100, gap_freq=10,
max_iter : int, optional
Maximum number of outer loop (working set definition) iterations.
gap_freq : int, optional
Number of epochs between every gap computation in the inner solver.
max_epochs : int, optional
Maximum number of epochs for the coordinate descent solver called on
the subproblems.
gap_freq : int, optional
Number of epochs between every gap computation in the inner solver.
p0 : int, optional
Size of the first working set.
Expand Down

0 comments on commit bf63a0d

Please sign in to comment.