Ian H.
Ian H.

Reputation: 3919

Specifying a training duration for a ML.NET model

This might be an obvious question, but I can't seem to find anything on it in the ML.NET Microsoft Documentation.

I've been trying to get into the ML.NET framework for a bit now, and the documentation always follows the same basic procedure, namely creating an estimator chain and fitting the chain to the data, essentially training the model.

The documentation also specifies that you should experiment with different training durations, which is where my question comes in: How do you specify a training duration? Every time I spot a "training" method in the docs, it's always just

ITransformer model = pipeline.Fit(data);

without any possibility to specify a training duration. Am I missing the obvious here? Do you specify the duration in the estimator chain? Any help on this is greatly appreciated.

Upvotes: 2

Views: 1968

Answers (1)

Alireza Mahmoudi
Alireza Mahmoudi

Reputation: 994

Machine learning algorithms have different behaviors, some models provide settings such as steps to be trained as input, or duration, or epoch, or error rate etc... and the result is different from one run to another. But some others, have a fixed algorithm and always have the same out put and no matter how many times you run trainer, the result is the same. I think your model is the latter case.

Note that changing the input parameters of the model change the training duration, In the machine learning context "different training durations" means changing the model's parameter to find the optimum values.

In your case, changing the following settings may change your training duration:

// Define trainer options.
var options = new LbfgsMaximumEntropyMulticlassTrainer.Options
{
    HistorySize = 50,
    L1Regularization = 0.1f,
    NumberOfThreads = 1
};

Upvotes: 2

Related Questions