Closed slonoten closed 7 years ago
Thanks for the possible solution.
When did you get this error? Was it after doing new XGBRegressor()/new XGBClassifier()
, after doing Fit()
, or after doing Predict()
?
Also, would you be able to share what code you used to create this error?
I got this error after doing Fit().
Simplest way to reproduce this issue is temporary change decimal separator character in control panel regional settings from '.' (dot) to ',' (comma). Another way is add
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ru-RU");
to code of unit test 'Predict' before call
XGBRegressor xgbr = new XGBRegressor();
If you add this code before
float[][] dataTrain = GetDataTrain();
you'll get similar error in float.Parse(string) call, which can be cured if specify instance of NumberFormatInfo as second parameter.
Ok, I've replicated the problem and I've pushed the changes.
If you want, I can update the NuGet package tomorrow with the change.
XGBGetLastError returns:
Possible solution is to use
System.Globalization.NumberFormatInfo
to specify dot as decimal separator: