Skip to content

IPredictor and related parts hiding #2251

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

Closed
TomFinley opened this issue Jan 25, 2019 · 1 comment
Closed

IPredictor and related parts hiding #2251

TomFinley opened this issue Jan 25, 2019 · 1 comment
Assignees
Labels
API Issues pertaining the friendly API

Comments

@TomFinley
Copy link
Contributor

We have a few types inside IPredictor.cs that are perhaps useful for internal infrastructure, but are not directly useful from the point of view of the IEstimator/ITransformer/MLContext public API.

The thing that makes me the most nervous are things like IPredictorProducing and IDistPredictorProducing, which are definitely marker interfaaces that we don't want, but I would argue we don't really want any of this to be public.

public interface IPredictorProducing<out TResult> : IPredictor

public interface IDistPredictorProducing<out TResult, out TResultDistribution> : IPredictorProducing<TResult>

There are a significant number of side effects from this, including the hiding of many other APIs that we want hidden anyway, since anything that is part of the IEstimator/ITransformer/IDataView/MLConext idiom does not take an IPredictor (it produces things that implement that interface, but generally we do not use that interface). So this will be a driver for hiding many other things.

@TomFinley TomFinley changed the title IPredictor and related evilness IPredictor and related parts hiding Jan 26, 2019
@TomFinley TomFinley added API Issues pertaining the friendly API and removed answered labels Jan 27, 2019
@TomFinley TomFinley self-assigned this Jan 31, 2019
@TomFinley
Copy link
Contributor Author

TomFinley commented Feb 4, 2019

This is somewhat tied in with the issue also of #1307, and also #2378. In attempting to resolve this issue, I see usages IPredictorProducing and descendants that cannot be replaced so easily, because depending on the options or other situations the type of object cannot be determined at compile time, due to calibrators. Some binary classification predictors will produce a calibrated model or not (e.g., averaged perceptron), so since there is no real object relationship they produce one of these types. However this is little better than if they had just gone and produced object as they are marker interfaces. So pursuant to #1604 this will be resolved by making the estimators just return whatever predictor object they "naturally" produce, though that will be resolved via #2378.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Issues pertaining the friendly API
Projects
None yet
Development

No branches or pull requests

1 participant