如何在 C# .net 核心中预测未来价格
How predict Future prices in C# .net core
我想根据之前的数据预测未来的价格
我想制作一个显示预测价格的门户网站。
我努力了:
时间序列
IDataView trainingDataView = mlContext.Data.LoadFromEnumerable(modelInputs);
// Build training pipeline
var dataProcessPipeline = mlContext.Forecasting.ForecastBySsa(
"Score",
nameof(ModelInput.priceA),
windowSize: 5,
seriesLength: 10,
trainSize: modelInputs.Count(),
horizon: 10,
confidenceLowerBoundColumn: "LowerBoundScore",
confidenceUpperBoundColumn: "UpperBoundScore",
confidenceLevel:0.95f
);
价格因因素和先前数据而异
但它不考虑任何影响因素
我也试过 :
var dataProcessPipeline = mlContext.Transforms.Categorical.OneHotEncoding(new[] { new InputOutputColumnPair("name", "name") })
.Append(mlContext.Transforms.Text.FeaturizeText("Date_tf", "Date"))
.Append(mlContext.Transforms.Concatenate("Features", new[] { "name", "Date_tf", "priceB" }));
// Set the training algorithm
var trainer = mlContext.Regression.Trainers.FastTree(labelColumnName: "priceA", featureColumnName: "Features");
但是获取特定日期的数据没有任何意义如果将我的日期变量更改为字符串它可以工作但不起作用
如果我制作可变数据
根据以前的数据和影响因素预测未来价格的最佳算法或技术是什么
您需要将日期列转换为整数。查看此示例以了解如何完成此操作:
https://github.com/gvashishtha/time-series-mlnet/blob/master/time-series-forecast.ipynb
我想根据之前的数据预测未来的价格 我想制作一个显示预测价格的门户网站。 我努力了: 时间序列
IDataView trainingDataView = mlContext.Data.LoadFromEnumerable(modelInputs);
// Build training pipeline
var dataProcessPipeline = mlContext.Forecasting.ForecastBySsa(
"Score",
nameof(ModelInput.priceA),
windowSize: 5,
seriesLength: 10,
trainSize: modelInputs.Count(),
horizon: 10,
confidenceLowerBoundColumn: "LowerBoundScore",
confidenceUpperBoundColumn: "UpperBoundScore",
confidenceLevel:0.95f
);
价格因因素和先前数据而异 但它不考虑任何影响因素 我也试过 :
var dataProcessPipeline = mlContext.Transforms.Categorical.OneHotEncoding(new[] { new InputOutputColumnPair("name", "name") })
.Append(mlContext.Transforms.Text.FeaturizeText("Date_tf", "Date"))
.Append(mlContext.Transforms.Concatenate("Features", new[] { "name", "Date_tf", "priceB" }));
// Set the training algorithm
var trainer = mlContext.Regression.Trainers.FastTree(labelColumnName: "priceA", featureColumnName: "Features");
但是获取特定日期的数据没有任何意义如果将我的日期变量更改为字符串它可以工作但不起作用 如果我制作可变数据 根据以前的数据和影响因素预测未来价格的最佳算法或技术是什么
您需要将日期列转换为整数。查看此示例以了解如何完成此操作:
https://github.com/gvashishtha/time-series-mlnet/blob/master/time-series-forecast.ipynb