Skip to content

FastTree EarlyStoppingRule definition is inconsistent with API #2520

Closed

Description

In FastTree, the EarlyStoppingRule is defined as

[Argument(ArgumentType.Multiple, HelpText = "Early stopping rule. (Validation set (/valid) is required.)", ShortName = "esr", NullName = "<Disable>")]
[TGUI(Label = "Early Stopping Rule", Description = "Early stopping rule. (Validation set (/valid) is required.)")]
public IEarlyStoppingCriterionFactory EarlyStoppingRule;

This can be specified like so:

var fastTreeTrainer = mlContext.Regression.Trainers.FastTree(new 
    Trainers.FastTree.FastTreeRegressionTrainer.Options {
        EarlyStoppingMetrics = 2,
        EarlyStoppingRule = new GLEarlyStoppingCriterion.Arguments()
    });

This exposes the IComponentFactory way of doing things in the public API, which seems to be inconsistent with the public API. One suggestion is to use an enum over the existing options.

That said, this does support custom early stopping methods through implementing IEarlyStoppingCriterionFactory.

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

Metadata

Assignees

Labels

APIIssues pertaining the friendly API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions