sktime / sktime

A unified framework for machine learning with time series
https://www.sktime.net
BSD 3-Clause "New" or "Revised" License
7.74k stars 1.32k forks source link

[ENH] inter-scitype adapters for estimators and default coercions #6892

Open fkiraly opened 1 month ago

fkiraly commented 1 month ago

We are seeing more and more examples where an estimator of one scitype should be considered as another, in composition.

Examples:

I think the cleanest way to address these would be:

fkiraly commented 1 month ago

FYI @Alex-JG3 re annotation. This could allow us to eat our cake and keep it, as the coercion to transformation would be silent.

fkiraly commented 1 month ago

FYI @sktime/core-developers

Alex-JG3 commented 1 month ago

I like this concept. Would the coercion wrappers require strict adherance to the base classes? Currently there are several annotators that don't quite adhere to BaseSeriesAnnotator which would make coercing them from type annotator X to type Y difficult.

It would be good to know if this is an issue in other parts of sktime.

fkiraly commented 1 month ago

@Alex-JG3, yes, this would of course require strict API compliance to work, like any kind of composition or reduction. Afaik sktime is the only package in the time series space that has strictly enough enforced APIs for it to enable complex composition. Except the annotation module, currently... but I hope we'll get there 😃

More explicitly, noncompliance with API specifications is not a problem in other parts of sktime, all other modules are more mature.

The reason for this is probably the different types of estimators under a single umbrella - anomaly detectors, changepoint detectors, segmenters, etc. Besides being complicated to define what these actually are on an API level, confusion is common, even in academic literature. Which is an explanation but not an excuse, of course.