Micro and Macro: On average, indicators represent who
Micro calculates the indicator by combining the count and Macro calculates the indicator for each category or group and then equals the average.
Learning objectives and first steps2 objectives 2 first fixes
Try to do it after reading
- Calculation of aggregate and grouping rights indicators
- Identify the big group to cover up the team
Suggested first
- Target function to oversee learning
- Basic training and validation cycle
Overall performance is different from typical grouping
Micro calculates the indicator by combining the count and Macro calculates the indicator for each category or group and then equals the average. The answers to the questions were different in both ways. When a group sample is large, it dominates the overall count; Macro gives each group the same weight, but may have a greater impact on the unstable estimates of very few sample groups.
Set up A with 90, correct 81, accuracy 0.9; The group B had 10, correct 5 and an accuracy of 0.5. The overall accuracy was 86/100 = 0.86, and the average inter-group parity was 0.9 + 0.5 = 0.7. 0.86 did not count correctly, and 0.7 did not. The difference was whether the weights were distributed by record or by group.
Accuracy, recall rate and F1 also need to be defined as their molecular denominators. The average precision and recall then F1 is not usually equal to the average F1 for each group. For example, a group of P = 1, R = 0.5 of F1 is about 0.667 and cannot be exchanged at random with another group count. The name of the indicator must be consistent with the fulfilment of the conclusion.
Missing category is not a harmless detail
(a) The recall rate denominator is 0 when a authentic slice is not sampled; In the absence of forecasts, the accuracy rate may also be undefined. The library allows the setting of a zero denominator policy, but automatically treats undefined values as 0, 1 or ignores, changing the average value of Macro. The report needs to retain the sample size and the strategy, rather than just give a beautiful decimal.
Industrial data are often grouped along geographical, temporal and user dynamics. In order to determine whether the model will be raised to a larger group only, the aggregate indicators, key group indicators and the number of groups can be presented together. Group rules should be clear before the final test results were seen.
Uncertainties also vary with the sample volume. The same level of stability was observed in the case of 0.5 recorded in 10 records and 0.5 recorded in 10,000 records. Macro gives the group the same weight, which does not mean giving the same statistical confidence; Trustive intervals or at least clear counting are needed to avoid the use of occasional fluctuations as a stable degradation.
This section uses a general definition of the classification indicators, and the library details refer to the current scikit-learn document. 0.86 and 0.7 are composite hand-countings that do not involve real business effects, and
The 90 accuracy rates of 0.9 in the A group, 0.5 in the B group, and the overall accuracy rate of 0.5 in the total?
(81+5)/100=0.86; The name cannot be commingled if the right is 0.7 per group.
Macro is more concerned about the team, is it always better than Micro?
No, it's not. A single conclusion does not represent the full range of risks, which should be selected according to the unit to be protected by the task, and a simultaneous view of the sample volume and zero denominator.
Sources and reconciliations
Definitions, methods and interfaces are available.
Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.