-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Make sure Done() is called in cleanup if it hasn't been called #4817
Conversation
@@ -455,7 +455,7 @@ private protected override VBuffer<float> InitializeWeightsFromPredictor(IPredic | |||
CurrentWeights.CopyTo(ref weights, 1, CurrentWeights.Length - 1); | |||
return new ParameterMixingCalibratedModelParameters<LinearBinaryModelParameters, PlattCalibrator>(Host, | |||
new LinearBinaryModelParameters(Host, in weights, bias, _stats), | |||
new PlattCalibrator(Host, -1, 0)); | |||
new PlattCalibrator(Host, 1, 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the bug is actually in the PlattCalibrator
itself:
While in the comment it says this:
/// The Platt calibrator calculates the probability following:
/// P(x) = 1 / (1 + exp(-<see cref="PlattCalibrator.Slope"/> * x + <see cref="PlattCalibrator.Offset"/>)
The actual calculation does this:
public float PredictProbability(float output)
{
if (float.IsNaN(output))
return output;
return PredictProbability(output, Slope, Offset);
}
internal static float PredictProbability(float output, Double a, Double b)
{
return (float)(1 / (1 + Math.Exp(a * output + b)));
}
The value here should be changed to 1 only if we change the computation in PlattCalibrator
. (looking at the baselines, the computation without the change looks better: label 1 examples give higher probabilities, and label 0 examples give lower probabilities.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
… PlattCalibrator in CalibratedModelParametersBase constructor
I remember you said this PR is still in progress, right? |
I forgot to add a draft flag earlier. I have changed the title to include WIP now. I will most likely close this PR and reopen a new one. In reply to: 584371281 [](ancestors = 584371281) |
This PR is superseded by #4823 . Closing this one. |
This makes sure call stack is collected for intermediate failures.