Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print_model_weights fails for multi-class logistic regression models #274

Closed
desilinguist opened this issue Jan 14, 2016 · 2 comments
Closed
Milestone

Comments

@desilinguist
Copy link
Member

Traceback (most recent call last):
  File "/Users/nmadnani/anaconda/envs/rsmtool/bin/print_model_weights", line 6, in <module>
    sys.exit(main())
  File "/Users/nmadnani/anaconda/envs/rsmtool/lib/python3.4/site-packages/skll/utilities/print_model_weights.py", line 56, in main
    (weights, intercept) = learner.model_params
  File "/Users/nmadnani/anaconda/envs/rsmtool/lib/python3.4/site-packages/skll/learner.py", line 712, in model_params
    if self.model.intercept_:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

It fails because self.model.intercept_ is an array and, as the error says, you can't treat an array as a bool. We don't have a test for this case - we check binary LogisticRegression, 2-class LinearRegression, and multi-class LinearSVR but not multi-class LogisticRegression. It's still surprising that no one else has run into this error though.

@desilinguist desilinguist added this to the 1.2 milestone Jan 14, 2016
@desilinguist
Copy link
Member Author

this will be addressed by #267

@desilinguist
Copy link
Member Author

Addressed by #267.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant