Page 219 - AI Computer 10
P. 219

Solution: Here, TP = 22, FP = 12, FN = 47, TN = 18

                         TP + TN
        Accuracy =                    × 100
                    TP + FP + FN + TN
                         28 + 18
                 =                    × 100
                    22 + 18 + 12 + 47

                 =  40  × 100 = 40.40%
                    99
                     TP         22      22
        Precision =        =          =     = 0.6470 or 64.70%
                   TP + FP    22 + 12   34
                     TP        22       22
           Recall =        =         =     = 0.3188 or 3188%
                   TP + FN   22 + 47    69
                   2 × Precision × Recall  2 × 0.6470 × 0.3188     0.4125272
        F1 Score =                       =                      =             =.4271
                      Precision + Recall     0.6470 + 0.3188        0.9658

        Example 2: A lot of times people face the problem of sudden downpour. People wash clothes and put them out
        to dry, but due to unexpected rain, the clothes become wet again and their efforts get wasted. Thus, an AI model
        has been created which predicts if there will be rain or not. The confusion matrix for the same is:

                             The Confusion Matrix           Reality: 1             Reality: 0
                            Predicted: 1             5                        0
                            Predicted: 0             45                       50


        Calculate Accuracy, Precision, Recall, and F1 Score for the above problem.
        Solution: Here, TP = 5, FP = 0, FN = 45, TN = 50

                         TP + TN
        Accuracy =                    × 100
                    TP + FP + FN + TN

                       5 + 50
                 =                × 100
                      5 + 0 + 45 + 50

                 =  55  × 100 = 50%
                     100

                     TP        5      5
        Precision =        =       =    = 1 or 100%
                   TP + FP   5 + 0    5

                  TP        5       5
        Recall =        =        =     = 0.1 or 10%
                TP + FN   5 + 45    50

        F1 Score =    2 × Precision × Recall  =  2 × 1 × 0.1  =  0.2  = 0.1818 or 18.18%
                      Precision + Recall    1 + 0.1     1.1
        ETHICAL CONCERNS AROUND MODEL EVALUATION

        As with all stages of AI project cycle, the evaluation stage also has ethical concerns related to it that need to be
        resolved to create a well-balanced AI model. While evaluating an AI model, the following ethical concerns need
        to be kept in mind:





                                                                                                              85
                                                                                                              85
   214   215   216   217   218   219   220   221   222   223   224