Skip to content

Commit 885d7fa

Browse files
brs96breakanalysis
andcommitted
Refactor LR focal loss doc
Co-authored-by: Jacob Sznajdman <[email protected]>
1 parent a2bf1d5 commit 885d7fa

File tree

3 files changed

+90
-5
lines changed

3 files changed

+90
-5
lines changed
Lines changed: 84 additions & 0 deletions
Loading

doc/modules/ROOT/pages/machine-learning/training-methods/logistic-regression.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ When `focusWeight` is a value greater than zero, the loss function changes from
3131

3232
image::equations/focal-loss.svg[align="center"]
3333

34-
The `focusWeight` parameter is the exponent noted as Greek letter gamma.
35-
Increasing `focusWeight` will guide the model towards trying to fit "hard" examples.
36-
A "hard" example is an example for which the model has a low predicted probability for the true class.
37-
In the above equation, the loss will be exponentially higher for low-probability examples, thus tuning the model towards trying to fit them, at the expense of potentially losing some "easy" examples.
34+
where `p~t~` denotes the probability of the true class.The `focusWeight` parameter is the exponent noted as Greek letter gamma.
35+
36+
Increasing `focusWeight` will guide the model towards trying to fit "hard" misclassified examples.
37+
A hard misclassified example is an example for which the model has a low predicted probability for the true class.
38+
In the above equation, the loss will be exponentially higher for low-true-class-probability examples, thus tuning the model towards trying to fit them, at the expense of potentially being less confident on "easy" examples.
3839

3940
In class-imbalanced datasets, the minority class(es) are typically harder to classify correctly.
4041
Read more about class imbalance for Link Prediction in xref:machine-learning/linkprediction-pipelines/theory.adoc#linkprediction-pipelines-classimbalance[Class Imbalance].

doc/modules/ROOT/partials/machine-learning/training-methods/logisticRegressionConfig.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ include::partial$/machine-learning/training-methods/gradient-descent-common-conf
77

88
include::partial$/machine-learning/training-methods/penalty-common-config.adoc[]
99

10-
| focusWeight | Float | 0.0 | yes | Exponent for the focal loss factor, to make the model focus more on hard, misclassified examples in the train set. By default, no focus is applied. Must be positive.
10+
| focusWeight | Float | 0.0 | yes | Exponent for the focal loss factor, to make the model focus more on hard, misclassified examples in the train set. The default of `0.0` implies that focus is not applied and cross entropy is used. Must be positive.
1111
|===

0 commit comments

Comments
 (0)