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

Sklearn compatibility #33

Open
enricopal opened this issue Jun 8, 2017 · 1 comment
Open

Sklearn compatibility #33

enricopal opened this issue Jun 8, 2017 · 1 comment

Comments

@enricopal
Copy link

Hello,
I was hoping to reuse the model selection routines of the Scikitlearn API (grid search CV and the like), but it appears that neither HMM nor the StructuredPerceptron are considered to be valid estimator (http://scikit-learn.org/stable/developers/contributing.html#rolling-your-own-estimator). By looking through the source code, everything seems to be abiding scikitlearn rules, but if I try:

from seqlearn.perceptron import StructuredPerceptron
from sklearn.utils.estimator_checks import check_estimator
model = StructuredPerceptron()
check_estimator(model)

I get:
AttributeError: 'StructuredPerceptron' object has no attribute 'name'

Any clue on how to fix this compatibility issue?
Thanks a lot in advance,
Enrico

@vene
Copy link
Contributor

vene commented Jun 8, 2017

Hi Enrico,

Currently the check_estimator function takes a class, not an instance, so you need to run

check_estimator(StructuredPerceptron)

instead. We will add support for testing individual instances in the future, though.

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

2 participants