In this page

Improved base class to be introduced in release 0.3.0

What is happening?

The upcoming release 0.3.0 will introduce an improved base object class BaseSMKObject which is consistent with sklearn.BaseEstimator.

This is a low-level change with direct impact on most components within scikit-multiflow. We have tried to minimize the impact on the end users and this post aims to reduce the uncertainty from this change.

How does this affect me?

Here are the considerations to have in mind to ensure a smooth transition, depending on your usage of scikit-multiflow.

I am a practitioner

If you are using scikit-multiflow methods without modifying them then the change should have minimum impact on your workflow. However some methods’ signatures were updated:

DataStream

FileStream

PageHinkley

KNN

Similarly, partial_fit and fit methods where updated for consistency with scikit-learn methods:

weight -> sample_weight

Note: “->” means “renamed to”

I am a developer/researcher

In case that you are modifying the scikit-multiflow methods or extending them to create your own methods then there are some considerations to take into account additional to the ones mentioned above.

The skmultiflow.core.BaseSKMObject class is the new base class in scikit-multiflow. It is based on sklearn.BaseEstimator in order to support inter-framework compatibility and adds extra functionality relevant in the context of scikit-multiflow.

Stream models (estimators) in scikit-multiflow are now created by extending the BaseSKMObject class and the corresponding task-specific mixin(s): ClassifierMixin, RegressorMixin, MetaEstimatorMixin, MultiOutputMixin

The ClassifierMixin defines the following methods:

The RegressorMixin defines the same methods for the regression setting with minor differences in the methods’ signatures.

Further information

If you are interested in finding more about this change you can check the corresponding issue and PR in GitHub. Or you can contact us through the user’s group or gitter channel.