Metriche repository
- Star
- (7162 star)
- Metriche merge PR
- (Merge medio 26g 10h) (86 PR mergiate in 30 g)
Descrizione
hmmlearn is a nifty python package with a lot of different sci-kit learn like estimators for using HMM algorithms.
We now have a simple way to wrap and thus import new HMM estimators into sktime, and I thought that it could be a great task for anyone new to sktime or open source in general to get started with if you are looking for an easy issue to contribute.
The estimators which still need to be wrapped are:
- CategoricalHMM
- MultinomialHMM
- PoissonHMM
Here is a rough guide for what needs to be done in order to wrap an estimator from hmmlearn:
- in the
sktime.annotations.hmm_learnfile add your new estimator to the__all__attribute list near the top of the file. - make a new class for your relevant
hmmlearnestimator. - right before this new class add the code which will ignore the soft dependency warning:
_check_soft_dependencies("hmmlearn.hmm", severity="warning") - copy over the docstring from
hmmlearninto your new class. Here is where the code lives on Github and you can check it out there. (may need to look into both the__init__function and the main class docstring in order to get both theParameterssection and theAttributesslash general description. - update the
__init__and_fitfunctions to properly collect and store all the attributes needed for your wrapped estimator. In_fitpass these parameters to a wrapped version of your estimator. - update the docstring example
- update the get_test_params method with some relevant params for your new estimator.
- add a quick test in test_hmm_learn that gaurantees your new wrapped estimator agrees with the estimator it is wrapping in
hmmlearn. It will be important to make sure both implementations have the same random state.
To see an example of what this should look like please check out my recent PR (#3362) for GMMHMM which has all these steps in it. If you would like top take on an estimator just comment in this issue so other people know you are working on it! :)