Skip to content

LinearPredictor.Statistics is always null #1006

Closed
@klausmh

Description

@klausmh

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.Statistics is 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:

.

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'):

// Building the variance-covariance matrix for parameters.
.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions