0

I'm working on a TimeSeries model, and need to analyze the anomalies of the data collection. To do that, I'm using DetectSpikeBySsa. But the thing is, what I need now it is to retrain the model for the future data.

I've already search for documentation, and I only got about other types of model, like LinearRegression.

https://learn.microsoft.com/en-us/dotnet/machine-learning/how-to-guides/train-machine-learning-model-ml-net

// Pipeline that I used
var pipeline = context.Transforms.DetectSpikeBySsa(
                            outputColumnName: nameof(DataPredicted.Prediction),
                            inputColumnName: nameof(DataPoints.value),
                            confidence: 99,
                            pvalueHistoryLength: data.Count() / numberOfDays,
                            trainingWindowSize: data.Count(),
                            seasonalityWindowSize: data.Count() / numberOfDays);
// Train and Save the model locally
ITransformer trainedModel = pipeline.Fit(dataComplete);
context.Model.Save(trainedModel, dataComplete.Schema, file);


// Loading the trained model in other instance
ITransformer trainedModel = context.Model.Load(file, out var modelInputSquema);

// After this I would like to retrain the model and analyze the differences between before and after.

The trained model is working well with the old data, but of course we need to retrain the model using the new data.

So, the questions are:

  1. How to get the parameters of the trained model (DetectSpikeBySsa)?
  2. How to retrain the model and compare the old one?

Thanks a lot! Any information will be appreciated.

1 Answers1

0

Currently one cannot re-train this model. According to docs.microsoft the following algorithms can be retrained.

Re-Train a Model in ML.Net

  • AveragedPerceptronTrainer
  • FieldAwareFactorizationMachineTrainer
  • LbfgsLogisticRegressionBinaryTrainer
  • LbfgsMaximumEntropyMulticlassTrainer
  • LbfgsPoissonRegressionTrainer
  • LinearSvmTrainer
  • OnlineGradientDescentTrainer
  • SgdCalibratedTrainer
  • SgdNonCalibratedTrainer
  • SymbolicSgdLogisticRegressionBinaryTrainer

It may be possible to add to your data and train a new model and save it with a different name. You could then evaluate both models and take the one with the better score. You may also want to try a different algorithm if the model perform poorly or alter the features of you model.

Brandon
  • 1,036
  • 2
  • 17
  • 19