Der Typ -Initialisierer für 'microsoft.ml.transforms.timeseries.fftutils' hat eine Ausnahme gemacht. in ml.net
Posted: 24 Feb 2025, 04:54
Code: Select all
int forecastSize = 144;
var dataPoints = 480;
List pciData = dataPoints.Select(x => new PCIDataPoint { Value = (float)x }).ToList();
IDataView dataView = mlContext.Data.LoadFromEnumerable(pciData);
// Define SSA Forecasting Model
var pipeline = mlContext.Forecasting.ForecastBySsa(
outputColumnName: "PCIForecastedValues", // Explicitly set the output column
inputColumnName: nameof(PCIDataPoint.Value), // Correct input column
windowSize: forecastSize, // Lookback window size
seriesLength: dataPoints.Count, // Entire series length
trainSize: dataPoints.Count, // Training data size
horizon: forecastSize, // Number of predictions
confidenceLevel: 0.95f, // Confidence level
confidenceLowerBoundColumn: "ConfidenceLowerBound",
confidenceUpperBoundColumn: "ConfidenceUpperBound"
);
// Train the model
var model = pipeline.Fit(dataView);