Trivial estimators should also be ITransformer #2354
Labels
API
Issues pertaining the friendly API
enhancement
New feature or request
P2
Priority of the issue for triage purpose: Needs to be fixed at some point.
We are making constructors of transformers internal as part of issue #1798. This makes the creation of non trainable transformers somewhat clumsy. This problem is already reported in the following issue #2165 by an external user.
Here is an example:
The problem here is the step where the call to
Fit()
is completely useless and feels silly. However, we need estimators for non trainable transformers to use them in estimator pipelines, and the estimator interface cannot change.One possible approach that we came up with @glebuk and @TomFinley is to make the 'trivial' estimators (estimators for non trainable transformers)
ITransformers
themselves. This is how the API would look like if we make this change, you can see that it is still possible to make the trivial estimators part of a pipeline:The conversion would be very simple. The estimator will have a field
ITransformer Transformer
which is instantiated in the constructor using the arguments passed to the constructor of the estimator (this is already done in cases where the estimator derive fromTrivialEstimator
which should be the case for non trainable estimators). The methods of the interfaceITransformer
will be implemented by calling the respective methods ofTransformer
. A sample conversion should look like the following:/cc @Ivanidzo4ka
The text was updated successfully, but these errors were encountered: