-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
System information
- OS version/distro: Win 10 / ML.NET 0.5.0
- .NET Version (eg., dotnet --info): 4.6.2
Issue
- What did you do?
I train a model using logistic regression:
var trainer = new LogisticRegression(
environment,
new LogisticRegression.Arguments() { ShowTrainingStats = true });
var trainRoles = ...
var predictor.Train(trainRoles)
-
What happened?
predictor.Statisticsis null -
What did you expect?
To be able to retrieve model statistics
Source code / logs
LogisticRegression.CreatePredictor does not pass its _stats LinearModelingStatistics field when it creates a LinearBinaryPredictor:
machinelearning/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LogisticRegression.cs
Line 327 in 1e7b8be
| new LinearBinaryPredictor(Host, ref weights, bias), |
If I do change that, then predictor.Statistics.GetCoefficientStatistics still returns null. It appears that you calculate the inverted Hessian, but then do not use it to calculate standard errors (and pass these in the constructor of `LinearModelStatistics'):
machinelearning/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LogisticRegression.cs
Line 189 in 1e7b8be
| // Building the variance-covariance matrix for parameters. |