Machine-Learning Error: Message=The weights/bias contain invalid values (NaN or Infinite). Potential causes: high learning rates, no normalization, high initial weights, etc

Machine-Learning Error: Message=The weights/bias contain invalid values (NaN or Infinite). Potential causes: high learning rates, no normalization, high initial weights, etc.

  Source=Microsoft.ML.StandardTrainers

Solution: If you are using OnlineGradientDescent Machine Learning Algorithm to train your Model, chances are that you have Featurized one of your Feature column in the dataset. What happened was that, after featurizing one of the columns in the IDataView backet, the feature column became bigger hence adding more overhead to the algorithm given it's initial Learning Rate of 0.1.

- Find the OnlineGradientDescent algorithm and fine tune it's learning rate from 0.1 to 0.001f. See the code below:

.Append(mlContext.Regression.Trainers.OnlineGradientDescent(labelColumnName: "yourColumnName", featureColumnName: "Features",learningRate: 0.001f,numberOfIterations: 10));

//You might get away with reducing numberOfIterations as well.