Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
162 views
in Technique[技术] by (71.8m points)

c# - ML.Net ParseSingle exception when getting REAL values from SQL

I'm trying to train the model in ML.Net (from the generator, using the value forecast scenerio) to forecast counters values (actually the differences between values) and I'm getting the exception:

   w System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
   w Microsoft.ML.AutoML.SweeperProbabilityUtils.ParameterSetAsFloatArray(IValueGenerator[] sweepParams, ParameterSet ps, Boolean expandCategoricals)
   w Microsoft.ML.AutoML.SmacSweeper.FitModel(IEnumerable`1 previousRuns)
   w Microsoft.ML.AutoML.SmacSweeper.ProposeSweeps(Int32 maxSweeps, IEnumerable`1 previousRuns)
   w Microsoft.ML.AutoML.PipelineSuggester.SampleHyperparameters(MLContext context, SuggestedTrainer trainer, IEnumerable`1 history, Boolean isMaximizingMetric)
   w Microsoft.ML.AutoML.PipelineSuggester.GetNextInferredPipeline(MLContext context, IEnumerable`1 history, DatasetColumnInfo[] columns, TaskKind task, Boolean isMaximizingMetric, CacheBeforeTrainer cacheBeforeTrainer, IEnumerable`1 trainerWhitelist)
   w Microsoft.ML.AutoML.Experiment`2.Execute()
   w Microsoft.ML.AutoML.ExperimentBase`2.Execute(ColumnInformation columnInfo, DatasetColumnInfo[] columns, IEstimator`1 preFeaturizer, IProgress`1 progressHandler, IRunner`1 runner)
   w Microsoft.ML.AutoML.ExperimentBase`2.Execute(IDataView trainData, ColumnInformation columnInformation, IEstimator`1 preFeaturizer, IProgress`1 progressHandler)
   w Microsoft.ML.ModelBuilder.AutoMLService.Experiments.AutoMLExperiment`3.<>c__DisplayClass21_0.<ExecuteAsync>b__5() w /_/src/Microsoft.ML.ModelBuilder.AutoMLService/Experiments/AutoMLExperiment.cs:wiersz 81
   w System.Threading.Tasks.Task`1.InnerInvoke()
   w System.Threading.Tasks.Task.Execute()
--- Koniec ?ladu stosu z poprzedniej lokalizacji, w której wyst?pi? wyj?tek ---
   w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w Microsoft.ML.ModelBuilder.AutoMLService.Experiments.AutoMLExperiment`3.<ExecuteAsync>d__21.MoveNext() w /_/src/Microsoft.ML.ModelBuilder.AutoMLService/Experiments/AutoMLExperiment.cs:wiersz 108
--- Koniec ?ladu stosu z poprzedniej lokalizacji, w której wyst?pi? wyj?tek ---
   w System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   w Microsoft.ML.ModelBuilder.AutoMLEngine.<StartTrainingAsync>d__30.MoveNext() w /_/src/Microsoft.ML.ModelBuilder.AutoMLService/AutoMLEngineService/AutoMLEngine.cs:wiersz 147

The problem is weird for me, because it only occurs when train time is longer than around 4-5 minutes. Before that it never happened, but that time is not enough to train the model. At the moment I'm passing only REAL values from SQL (so there should not be a problem to convert to float I guess, there are just numerical values and all of them are REAL, nothing else).

I'm willing to get the estimated value of the counter just by passing number of month, day and if it's weekend or not - I know that may not be enough, but that's just for the beginning of my research, and as you can see, it's not even working properly. What am I doing wrong? Is it a problem with my database or some ML.Net problem that needs to be patched? If it has any problem with just one data row, I would like it to just skip the one that cannot be parsed.

Also, to really use that model I would like to not only tell what day I would like to know, but also what was the energy usage in the past days, so it could estimate the future usage better. Don't really know how do I need to prepare the data for training and how to set the model to achieve that? Any suggestions would be appreciated. Thanks in advance!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...