Skip to content

Commit 966b0f3

Browse files
justinormontcodemzs
authored andcommitted
Add needed param to warning for L2 in SDCA (dotnet#597)
* Fix warning for L2 in SDCA * String interpolation * Word-smithing the warning message
1 parent bc87d62 commit 966b0f3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Microsoft.ML.StandardLearners/Standard/LinearClassificationTrainer.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,9 @@ internal virtual void Check(IHostEnvironment env)
207207
{
208208
using (var ch = env.Start("SDCA arguments checking"))
209209
{
210-
ch.Warning("The specified l2Const = {0} is too small. SDCA optimizes the dual objective function. " +
211-
"The dual formulation is only valid with a positive L2 regularization. Also, an l2Const less than {1} " +
212-
"could drastically slow down the convergence. So using l2Const = {1} instead.", L2Const);
213-
210+
ch.Warning($"The L2 regularization constant must be at least {L2LowerBound}. In SDCA, the dual formulation " +
211+
$"is only valid with a positive constant, and values below {L2LowerBound} cause very slow convergence. " +
212+
$"The original {nameof(L2Const)} = {L2Const}, was replaced with {nameof(L2Const)} = {L2LowerBound}.");
214213
L2Const = L2LowerBound;
215214
ch.Done();
216215
}
@@ -1752,4 +1751,4 @@ public static CommonOutputs.BinaryClassificationOutput TrainBinary(IHostEnvironm
17521751

17531752
}
17541753
}
1755-
}
1754+
}

0 commit comments

Comments
 (0)