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

The trainer API for MLContext is inconsistent for learner in external nugets #1827

singlis opened this Issue Dec 5, 2018 · 1 comment


2 participants

singlis commented Dec 5, 2018

APIs are discoverable via the MLContext. There are some learners that are declared on the MLContext where other learners define an MLContext extension in cases where the learner is in a separate nuget package.

This results inconsistent API calls when accessing APIs, for example BinaryClassification vs Recommendation():

var foo_bar = mlContext.BinaryClassification.Trainers;
var foo_moo_bar = mlContext.Recommendation().Trainers;

The API discover ability should be consistent and work across nuget pakages.
Original issue: #1806

This issue may be the solution #1319 as it creates extensions for the trainers.


This comment has been minimized.


Zruty0 commented Dec 5, 2018

This inconsistency was expected by design from the first day: we planned to have properties for 'standard' tasks (available in Microsoft.ML NuGet) and methods for tasks that are added in separate NuGets (time series, recommendation, etc.)

If you have any suggestion on how to make them consistent, please make it. The only way I see that we can reconcile the calls is to make all existing properties into methods:

var foo1 = mlContext.BinaryClassification().Trainers().LogisticRegression();
var foo2 = mlContext.Transforms().Categorical().OneHotEncoding();


I do not like this solution: a natural way to represent catalogs is by making them properties. I think sacrificing this natural design in order to make the calls to common and less-common parts of the API more similar is not a good idea.

@sfilipi sfilipi added this to To do in Project 13 via automation Dec 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment