BCG-X-Official / sklearndf

DataFrame support for scikit-learn.
https://bcg-x-official.github.io/sklearndf/
Apache License 2.0
63 stars 7 forks source link

FIX: dynamically determine the _estimator_type attribute #181

Closed j-ittner closed 3 years ago

j-ittner commented 3 years ago

This PR implements _estimator_type as a @property of class EstimatorWrapperDF to provide the access of the same attribute in the delegate native estimator.

Also, this PR ensures that DF wrapper classes do not subclass more than one of RegressorDF, ClassifierDF, or TransformerDF; for classes that did this in the past this PR instead introduces a hierarchy of subclasses each of which only implements one estimator type. As the only exception, allow PipelineWrapperDF still implements RegressorDF, ClassifierDF and TransformerDF all at once, but relies on the _estimator_type property to delegate to the native pipeline instance.