# Towards Automatic Landslide-Quake Identification Using a Random Forest Classifier
## 2 Study Materials and Method
### Classifier Performance  
The confusion matrix is the most commonly used tool for presenting the performance of supervised machine learning algorithms. It can effectively and clearly represent the accuracy of a classifier and its sensitivity to various types of events [24]. Given a classifier and a targeted event, there are four possible outcomes. If the event is positive and it is classified as positive, it is counted as a true positive (TP); if it is classified as negative, it is counted as a false negative (FN). If the instance is negative and it is classified as negative, it is counted as a true negative (TN); if it is classified as positive, it is counted as a false positive (FP). Given a classifier and a set of validation events, a two-by-two confusion matrix can be created to represent the classification results of the set of events (Table 2). The three indicators (i.e., sensitivity, precision, and accuracy) are often used in the confusion matrix to evaluate the performance of the classifier. The sensitivity (also called recall) of the classifier is estimated as:  
\[\text{Sensitivity}=\text{TP}/(\text{TP}+\text{FN}), \tag{8}\]  
The precision of the classifier is:  
\[\text{Precision}=\text{TP}/(\text{TP}+\text{FP}), \tag{9}\]  
The accuracy of the classifier represents the proportion of all correctly classified events to the total number of events, and is calculated as:  
\[\text{Accuracy}=(\text{TP}+\text{TN})/(\text{TP}+\text{TN}+\text{FP}+\text{ FN}), \tag{10}\]  
\begin{table}
\begin{tabular}{l l} \hline \hline \multicolumn{1}{c}{**Time-Domain Attributes**} & \multicolumn{1}{c}{**Frequency-Domain Attributes**} \\ \hline T1. \(\mu\)MA & F10. 0.02–0.05 Hz PSD (LF1) \\ T2. \(\sigma\)MA & F11. 0.05–0.1 Hz PSD (LF2) \\ T3. MAR & F12. 0.02–0.1 Hz PSD (LF3) \\ T4. \(\sigma\)MA/\(\mu\)MA & F13. 0.1–1 Hz PSD (LF4) \\ T5. \(\mu\)SI & F14. 1–5 Hz PSD (HF1) \\ T6. \(\sigma\)SI & F15. 5–8 Hz PSD (HF2) \\ T7. SIR & F16. 1–8 Hz PSD (HF3) \\ T8. \(\sigma\)SI/\(\mu\)SI & F17. LF1/HF1 (RPSD11) \\ T9. Mean of absolute amplitude & F18. LF1/HF2 (RPSD12) \\  & F19. LF2/HF1 (RPSD21) \\  & F20. LF2/HF2 (RPSD22) \\  & F21. LF3/HF3 (RPSD33) \\  & F22. F\_max \\  & F23. F\_high \\  & F24. F\_low \\ \hline \hline \end{tabular}
\end{table}
Table 1: Twenty-four attributes used to create the classifier.  
Since the training database used in this study was not large (\(<\)1000 samples), K-fold cross validation was employed to effectively use every sample. K-fold cross validation divides the database into K subsets. The samples of each class in each subset will have similar proportions. During the construction of the classifier, one subset is used as a validation set each time, and the remaining K-1 subsets are used as training sets (Figure 7). Repeated K times, each test will get one classification accuracy and then the average K results to get the final performance of classification [25]. The K value used in this study was five. After five-fold cross validation, the values in the mean confusion matrix were obtained by summing up the confusion matrixes of the five tests. The mean sensitivity, precision, and accuracy were the averages of five tests.