Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 8810d97

Browse files
committed
Check whether the shape of weights is the same with the shape of observations
1 parent ca24c77 commit 8810d97

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎glmnet/logistic.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ def fit(self, X, y, groups=None, sample_weight=None, relative_penalties=None):
207207
else:
208208
sample_weight = np.asarray(sample_weight)
209209

210+
if y.shape != sample_weight.shape:
211+
raise ValueError('the shape of weights is not the same with the shape of y')
212+
210213
if not np.isscalar(self.lower_limits):
211214
self.lower_limits = np.asarray(self.lower_limits)
212215
if len(self.lower_limits) != X.shape[1]:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /