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
Classifier base class #1517
Classifier base class #1517
Conversation
…g-institute/sktime into classifier_base_class
_predict made abstract, _ predict_proba given a default implmentation n_classes_ added to base class
quick question, while you're at it: do you want to add the planned support for the various All it would take is adding one or two |
Not on this PR, I want to finish refactor to fit first then look at checking and transforming data, one thing at a time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a fix to the default predict_proba and introduced a threading tag.
Happy with this, next step is to finish the refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- docstrings of
BaseObject.get_tag
are changed from sth that's correct imo to sth that's incorrect? This is a very small change, but a blocker. - I think the default behaviour in
_predict
should remain? Perhaps with a check whether an infinite look occurs (in the public part of the function) that raises an error. - Happy with the changes to the
BaseClassifier
, but I think we need to add a section to the docstring that explains the state change caused byfit
etc. SeeBaseForecaster
. Good to have but not a blocker.
…into classifier_base_class
…g-institute/sktime into classifier_base_class
yes, fixed, my misunderstanding (see above)
I dont. Your extension guidelines say that _predict must be implemented. I see no value in this default behaviour, it will allow the user to run code which should raise an error, if, say, they implement _predicted instead of _predict
yes I agree, on the next PR for base when I change the checking/recasting/capabilities, I want to push through the fit refactor first. |
Use markus's github instead of full name, added matthew.
@TonyBagnall, generally please ask for re-review if changes have been requested and don't merge. The above has not been addressed, it's an interface breaking change, so it should not have been merged. It breaks the interface for anyone who has locally implemented a classifier and has only implemented I don't think we should remove the "create But in-principle I'm fine with this as long as we deprecate properly. |
your own extension template stated that _predict must be implemented, and did not even mention _predict_proba. I recently had a student who implemented _predict as instructed on the template, but it failed when calling _predict_proba. Feel free to revise, I will review, but please leave the default predic_proba in there. This is how I think it should be |
I'm ok with a default predict, but you then need to change the extension template to make it clear you need one of them. I'm not that concerned at the moment about this, so will leave it to you. |
Three things here:
I'd be fine if the "user" contract guarantees I'm in-principle fine with any "should" state that you put out there, as long as the contracts are clearly stated and consistent; and as long as interface changes are properly deprecated. |
What does this implement/fix? Explain your changes.
Some changes to the base class for classifiers and the tags
some not dependent on the data could be move down, but will be defined so may as well have them in the base imo
coerce_to_numpy = self.get_tag("coerce-X-to-numpy")
its not complete and probably should not be here, I imagine I put it there.
note there will be a few more refinements, but this will allow us to blast through the fit/_fit refactor