You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ya_glm/base/Glm.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,13 @@
15
15
16
16
_glm_base_params=dedent("""
17
17
fit_intercept: bool
18
-
Whether or not to fit an intercept.
18
+
Whether or not to fit an intercept. The intercept will not be penalized.
19
19
20
20
standardize: bool
21
-
Whether or not to perform internal standardization before fitting the data. Here standardization means mean centering and scaling each column by its standard deviation. Putting each column on the same scale makes sense for fitting penalized models. Note the fitted coefficient/intercept is transformed to be on the original scale of the input data.
21
+
Whether or not to perform internal standardization before fitting the data. Standardization means mean centering and scaling each column by its standard deviation. For the group lasso penalty an additional scaling is applied that scales each variable by 1 / sqrt(group size). Putting each variable on the same scale makes sense for fitting penalized models. Note the fitted coefficient/intercept is transformed to be on the original scale of the input data.
22
22
23
23
opt_kws: dict
24
-
Keyword arguments to the glm solver optimization algorithm.
24
+
Additional keyword arguments for solve_glm.
25
25
""")
26
26
27
27
@@ -102,7 +102,7 @@ def _validate_data(self, X, y, sample_weight=None, accept_sparse=True):
102
102
103
103
defpreprocess(self, X, y, sample_weight=None, copy=True):
104
104
"""
105
-
Preprocesses the data for fitting. This method may transform the data e.g. centering and scaling X. If sample weights are provided then these are used for computing weighted means / standard deviations for standardization.
105
+
Preprocesses the data for fitting. This method may transform the data e.g. centering and scaling X. If sample weights are provided then these are used for computing weighted means / standard deviations for standardization. For the group lasso penalty an additional scaling is applied that scales each variable by 1 / sqrt(group size).
106
106
107
107
Parameters
108
108
----------
@@ -138,8 +138,8 @@ def preprocess(self, X, y, sample_weight=None, copy=True):
138
138
groups=groups,
139
139
sample_weight=sample_weight,
140
140
copy=copy,
141
-
check_input=False,
142
-
accept_sparse=False, # TODO!
141
+
check_input=True,
142
+
accept_sparse=True,
143
143
allow_const_cols=notself.fit_intercept)
144
144
145
145
y, y_out=self._process_y(y, sample_weight=sample_weight, copy=copy)
The l1_ratio value to use. If a float is provided then this parameter is fixed and not tuned over. If l1_ratio='tune' then the l1_ratio is tuned over using an automatically generated tuning parameter sequence. Alternatively, the user may provide a list of l1_ratio values to tune over.
0 commit comments