Page 230 - AI Ver 3.0 class 10_Flipbook
P. 230

Classification usually refers to categorisation of a specific class label that needs to be predicted from the given
              input field of data as a result. For example, here we are working on a pure vegetarian service model that predicts
              whether the item served is for a pure vegetarian or for all.

              Classification Metrics

              When evaluating a classification model, it’s important to measure its performance using various metrics. These
              metrics help assess how well the model predicts the correct classes. Here are some popular metrics used for
              classification models:

                 • Confusion matrix
                 • Classification accuracy
                 • Precision
                 • Recall

                       Confusion Matrix


              A confusion matrix is a performance evaluation tool used in machine learning to assess the performance of
              a classification model. It is a tabular representation that compares the actual labels (true outcomes) with the
              predicted labels (model predictions). The table is made with 4 different combinations of predicted and actual
              values in the form of 2×2 matrix. The comparison between the prediction and the reality can be used to evaluate
              the rate of success. It also gives a clear picture of which classes are being predicted correctly and incorrectly, and
              the types of errors are being made.
              This matrix is also known as the Error Matrix and is used in situations where we need to evaluate the performance
              of the model, identify errors, and find ways to improve the efficiency of the model. It is useful for measuring Recall,
              Precision, Accuracy and F1 Score.
              The following confusion matrix table illustrates how the 4-classification metrics are calculated (TP, FP, FN, TN), and
              how our predicted value is compared to the actual value in the confusion matrix.


                                                                                      Prediction
                                 Confusion Matrix
                                                                             Yes                       No

                                                    Yes                True Positive (TP)      False Negative (FN)
                          Actual
                                                    No                 False Positive (FP)     True Negative (TN)

              In the Confusion Matrix,
                 • The target variable has two values: Positive and Negative.
                 • The columns (Y-axis) represent the actual values of the target variable.

                 • The rows (X-axis) represent the predicted values of the target variable.
                 • The numbers in each cell represent the number of predictions made by the machine learning algorithm in each
                category
              To understand the confusion matrix, let’s understand the following terms:
                 • Positive: The prediction is positive for the scenario. For example, it will rain today.

                 • Negative: The prediction is negative for the scenario. For example, it will not rain today.
                 • True Positive: The predicted value matches the actual value i.e.; the actual value was positive and the model
                predicted a positive value.

                    228     Touchpad Artificial Intelligence (Ver. 3.0)-X
   225   226   227   228   229   230   231   232   233   234   235