Skip to content

FastTree LearningRate not settable thru arguments object #1983

Closed

Description

@daholste

Issue

  • What did you do?
            Action<FastTreeBinaryClassificationTrainer.Arguments> argsFunc = (args) =>
            {
                args.LearningRates = 0.1;
            };
            var trainer = mlContext.BinaryClassification.Trainers.FastTree(advancedSettings: argsFunc);
  • What happened?
    trainer.Args.LearningRate = the default learning rate of 0.2

  • What did you expect?
    trainer.Args.LearningRate = 0.1

I think this happens because

if (Args.LearningRates != learningRate)
            {
                using (var ch = Host.Start($"Setting learning rate to: {learningRate} as supplied in the direct arguments."))
                    Args.LearningRates = learningRate;
            }

in BoostingFastTree.cs

Activity

  1. changed the title [-]FastTree LearningRate not settable thru arguments[/-] [+]FastTree LearningRate not settable thru arguments object[/+] on Dec 29, 2018
  2. yaeldekel commented on Jan 2, 2019

    @yaeldekel

    Hi @daholste , thank you for your question! I looked at the code, and it seems that in all the other arguments that can be specified directly (minLeaves, numTrees and minDataPointsInLeaves), the advanced settings Action overwrites the directly specified values. @sfilipi , do you know if this is intentional or not?

    @daholste , until this issue is resolved, you can specify the learning rate directly and that should work.

  3. sfilipi commented on Jan 2, 2019

    @sfilipi
    Member

    We had the directly specified values override the advanced settings, than decided to swap and to have the advancedSettings override the directly specified values. If this is not happening for this trainer, we should fix it.

  4. daholste commented on Jan 11, 2019

    @daholste
    ContributorAuthor

    Also, for Fast Forest, the trainer constructor takes 'learning rate', but the arguments object does not have a property for learning rate. This differs from Fast Tree, LightGbm, and all other algos that accept learning rate, where learning rate is a field on the arguments object if it's a parameter that can be set. It would be awesome & really useful if learning rate could be added to the Fast Forest arguments object. Thank you!

  5. singlis commented on Jan 24, 2019

    @singlis
    Member

    This issue was resolved with the PR above, so I am closing this issue.

    At the same time @daholste mentioned not being able to set the learning rate on the Arguments for Fast Forest but can set the learning rate as part of the constructor. After investigating (thanks @yaeldekel ), there should not be a learningRate argument for FastForest -- this was added by mistake. I created a bug to remove learningRate from the FastForest constructor.

    Here is the issue for reference: #2237

  6. ghost locked as resolved and limited conversation to collaborators on Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions