DetectSpikeBySsa 获取模型参数并重新训练它 (ML.NET v1.2.0)

DetectSpikeBySsa get model parameters and retrain it (ML.NET v1.2.0)

我正在处理 TimeSeries 模型,需要分析数据收集的异常情况。为此,我使用 DetectSpikeBySsa。但问题是,我现在需要的是为未来的数据重新训练模型。

我已经搜索过文档,但我只了解了其他类型的模型,例如 LinearRegression。

https://docs.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.

经过训练的模型在旧数据上运行良好,但我们当然需要使用新数据重新训练模型。

所以,问题是:

  1. 如何获取训练模型(DetectSpikeBySsa)的参数
  2. 如何重新训练模型并与旧模型进行比较?

非常感谢!任何信息将不胜感激。

目前无法重新训练此模型。根据 docs.microsoft 可以重新训练以下算法。

Re-Train a Model in ML.Net

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

也许可以添加到您的数据并训练一个新模型并用不同的名称保存它。然后,您可以评估这两个模型并选择得分更高的模型。如果模型表现不佳或改变模型的特征,您可能还想尝试不同的算法。