bokbokbok.eval_metrics.binary_classification
F1_Score_Binary(XGBoost=False, *args, **kwargs)
¶
Implements the f1_score metric from scikit learn
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args
|
Any
|
The arguments to be fed into the scikit learn metric. |
()
|
XGBoost
|
Bool
|
Set to True if using XGBoost. We assume LightGBM as default use.
Note that you should also set |
False
|
Source code in bokbokbok/eval_metrics/classification/binary_eval_metrics.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
WeightedCrossEntropyMetric(alpha=0.5, XGBoost=False)
¶
Calculates the Weighted Cross Entropy Metric by applying a weighting factor alpha, allowing one to trade off recall and precision by up- or down-weighting the cost of a positive error relative to a negative error.
A value alpha > 1 decreases the false negative count, hence increasing the recall. Conversely, setting alpha < 1 decreases the false positive count and increases the precision.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
alpha
|
float
|
The scale to be applied. |
0.5
|
XGBoost
|
Bool
|
Set to True if using XGBoost. We assume LightGBM as default use.
Note that you should also set |
False
|
Source code in bokbokbok/eval_metrics/classification/binary_eval_metrics.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
WeightedFocalMetric(alpha=1.0, gamma=2.0, XGBoost=False)
¶
Implements alpha-weighted Focal Loss
The more gamma is increased, the more the model is focussed on the hard, misclassified examples.
A value alpha > 1 decreases the false negative count, hence increasing the recall. Conversely, setting alpha < 1 decreases the false positive count and increases the precision.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
alpha
|
float
|
The scale to be applied. |
1.0
|
gamma
|
float
|
The focusing parameter to be applied |
2.0
|
XGBoost
|
Bool
|
Set to True if using XGBoost. We assume LightGBM as default use.
Note that you should also set |
False
|
Source code in bokbokbok/eval_metrics/classification/binary_eval_metrics.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|