Mastering Machine Learning for Penetration Testing
上QQ阅读APP看书,第一时间看更新

Performance evaluation 

Evaluation is a key step in every methodological operation. After building a product or a system, especially a machine learning model, we need to have a clear vision about its performance, to make sure that it will act as intended later on. In order to evaluate a machine learning performance, we need to use well-defined parameters and insights. To compute the different evaluation metrics, we need to use four important parameters:

  • True positive
  • False positive
  • True negative
  • False negative

The notations for the preceding parameters are as follows:

  • tp: True positive
  • fp: False positive
  • tn: True negative
  • fn: False negative

There are many machine learning evaluation metrics, such as the following: 

  • Precision: Precision, or positive predictive value, is the ratio of positive samples that are correctly classified pided by the total number of positive classified samples:

  • Recall: Recall, or the true positive rate, is the ratio of true positive classifications pided by the total number of positive samples in the dataset:

  • F-Score: The F-score, or F-measure, is a measure that combines the precision and recall in one harmonic formula:

  • Accuracy: Accuracy is the ratio of the total correctly classified samples pided by the total number of samples. This measure is not sufficient by itself, because it is used when we have an equal number of classes.
  • Confusion matrix: The confusion matrix is a graphical representation of the performance of a given machine learning model. It summarizes the performance of each class in a classification problem.