-
Notifications
You must be signed in to change notification settings - Fork 0
ITrivialEstimator (Approach 1) #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| /// there is no easy way to infer it from the transformer. | ||
| /// </summary> | ||
| public abstract class TrivialEstimator<TTransformer> : IEstimator<TTransformer> | ||
| public abstract class TrivialEstimator<TTransformer> : ITrivialEstimator<TTransformer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TrivialEstimator [](start = 26, length = 16)
TrivialEstimatorBase
| private protected readonly IHost Host; | ||
| [BestFriend] | ||
| private protected readonly TTransformer Transformer; | ||
| internal readonly TTransformer Transformer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nternal readonly TTransformer Transformer; [](start = 9, length = 42)
private protected
| } | ||
|
|
||
| public TTransformer Fit(IDataView input) | ||
| public virtual TTransformer Fit(IDataView input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual [](start = 15, length = 7)
remove
| return Transformer; | ||
| } | ||
|
|
||
| public virtual IDataView Transform(IDataView input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual [](start = 15, length = 7)
remove virtual
| private protected readonly IHost Host; | ||
| [BestFriend] | ||
| private protected readonly TTransformer Transformer; | ||
| internal readonly TTransformer Transformer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transformer [](start = 39, length = 11)
not needed
| Host.CheckValue(input, nameof(input)); | ||
| // Validate input schema. | ||
| Transformer.GetOutputSchema(input.Schema); | ||
| return Transformer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transformer [](start = 19, length = 11)
return this.
I am a bit concerned about the fact that we have to .Fit(...) for non trainable transforms. I think it can make ML.NET look really bad! I worked on a solution for the problem...
I tried three approaches:
For each one of these the difficult part is making sure that the estimator/transformer chains work properly. So I implemented a TrivialEstiamtorChain that mimics EstimatorChain but on the class TrivialEstimator instead of the interface IEstimator.
For 1. and 2. I did not manage to make it work... When you .Append() two trivialestimators it will just have a difficult time to distinguish whether you want to create a new EstimatorChain or a TransformerChain.
For 3. I managed to make it work, I think! The .Append() works and will switch to an EstimatorChain as soon as a trainable estimator is added to the pipeline.
Is it fine not having a class/interface that combines ITransformer and IEstimator?