Skip to content

The curious case of TrainedWrapperEstimatorBase and friends #2841

Open
@TomFinley

Description

@TomFinley

So, while I was doing another round of internalization, one thing that I internalized was this. (Basically, something to handle the shimming from the now internal IDataTransform interface to the new ITransformer interface, during the regrettable situations -- thankfully few -- where such a thing is still necessary. So this:

public sealed class TransformWrapper : ITransformer

and this

public abstract class TrainedWrapperEstimatorBase : IEstimator<TransformWrapper>

Now, that's all fine, but after doing the necessary work it seemed that I could delete the estimator wrapper entirely, but then I see this very intriguing note.

/// <summary>
/// DO NOT USE IT!
/// Purpose of this method is to enable legacy loading and unwrapping of RowToRowTransform.
/// It should be removed as soon as we get rid of <see cref="TrainedWrapperEstimatorBase"/>
/// Returns parent transfomer which uses this mapper.
/// </summary>
ITransformer GetTransformer();

I do not understand what is going on here. This is not essential -- everything here is internal -- but it seems at least odd. This seems to indicate that this method and the class I wanted to delete have something to do with each other, but as far as I can tell they have nothing to do with each other whatsoever. But then why the comment?

Anyway, there's clearly something odd going on. This is absolutely not critical, but I wanted to register an issue about the oddness, since the code underlying it passes my understanding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority of the issue for triage purpose: Needs to be fixed at some point.code-sanitationCode consistency, maintainability, and best practices, moreso than any public API.need infoThis issue needs more info before triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions