# A Survey on Bug Deduplication and Triage Methods from Multiple Points of View
## 3 The Roadmap of Existing Literature
### Background Knowledge
#### 3.2.2 Similarity Evaluation Model  
(1) BM25F  
BM25F (Best Matching 25 with Fields) is a classical method used to measure the similarity between texts. This method calculates a score based on the frequency of occurrence of words in different weighted segments of an article. Formula (9) represents the calculation process:  
\[Score(Q,d)=\sum_{k=1}^{n}\log\frac{N-n(q_{i})+0.5}{n(q_{i})+0.5}\cdot\frac{f_{ i}^{u}}{k_{1}+f_{i}^{u}} \tag{9}\]  
where \(f_{i}^{u}=\sum_{u}^{k=1}w_{k}\cdot\frac{f_{ui}}{1-b_{u}+b_{u}\cdot\frac{uuu}{ input}}\), \(f\) is a word frequency statistical function, \(n\) is the number of texts containing a certain word, and \(ul_{u}\) and \(uvul_{u}\) represent the text segment fields. (2) Support Vector Machine (SVM)  
SVM is a supervised method that focuses on extracting feature vectors from bug reports. It can label these feature vectors and train an SVM to construct a hyperplane that maximizes the distance between feature vectors labeled with different tags. For linear SVM, the general form of its hyperplane is  
\[g(x)=\omega\cdot x+b=0 \tag{10}\]  
where \(x\) is an n-dimensional vector. Solving the most optimistic hyperplane is essentially solving the problem indicated by Equation (11). \[min(\frac{1}{2}(\omega\cdot\omega)+C\sum_{i=1}^{l}\varepsilon_{i}) \tag{11}\]  
where \(y_{i}[(\omega\cdot x)+b]+\varepsilon_{i}\geq 1\) for \(i\) in \(1\ldots l\), and \(\varepsilon_{i}\) represents the slack variables in the case of linear inseparability. Nonlinear SVM only requires replacement of the direct inner product in linear SVM with a kernel function. Widely used kernel functions include the polynomial kernel, sigmoid kernel, and radial basis function kernel. \[Polynomial kernel:(\gamma x_{i}^{T}x_{j}+r)^{d},\gamma>0 \tag{12}\]\[Sigmoid\ kernel:exp(-\gamma||x_{i}-x_{j}||^{2}),\gamma>0 \tag{13}\]  
\[rbf\ kernel:\tan h(\gamma x_{i}^{\rm T}x_{j}+r),\gamma>0 \tag{14}\]  
(3) Logistic Regression  
After extracting feature vectors from bug reports, one can use logistic regression to make predictions by training a model, as shown in Equation (15). The training process involves solving for the parameters in the equation to maximize the likelihood estimation for the data in the training set. \[ \begin{split} P(x,y,B)=\frac{exp(\beta_{k}^{T}x)}{\sum_{K}^{j=1} B_{j}x}\\ I(B,D)=\sum_{i}[\sum_{k}y_{ik}\beta_{k}^{T}x_{i}-\ln\sum_{k}exp( \beta_{k}^{T}x_{i})]\end{split}  \tag{15}\]  
(4) Naive Bayes  
Consistent with the idea of Logistic Regression, the naive Bayes model is constructed using the eigenvectors of bug reports as shown in Formula (16). \[P(y|x_{1},x_{2},\ldots,x_{d})=C\cdot P(y)\prod_{i=1}^{d}P(x_{i}|y) \tag{16}\]  
The final calculation process is the process of determining the corresponding result of the maximum probability (\(P\)), expressed as  
\[y=argmax_{y}P(y)\prod_{i=1}^{d}P(x_{i}|y) \tag{17}\]  
Specific to the bug report containing the text, the probability of using the parameter to divide the document can be expressed as:  
\[P(r_{j},d_{j},\theta)=\prod_{k=1}^{r}P(w_{k},d_{j},\theta)^{N_{k}} \tag{18}\]  
Here, the variable \(P(w_{k},d_{j},\theta)\) can be calculated after considering the statistical count of words and the frequency of occurrence of all words in a particular bug report. In this context, it is generally assumed that the words are independent. Otherwise, when calculating \(P(w_{k},d_{j},\theta)\), parameters (\(\lambda\)) are introduced to recompute the frequency of word occurrences in the report. (5) K-Nearest Neighbors  
After obtaining the feature vector of a bug report, the KNN model calculates the distances between features using the Minkowski distance function (as shown in Equation (19)). It selects the k nearest points based on distance and assigns the majority class among those points to the current bug report. \[dis(x,y)=\sqrt[r]{(x_{0}-y_{0})^{p}+(x_{1}-y_{1})^{p}+\cdots+(x_{k}-y_{k})^{p}} \tag{19}\]  
(6) Random Forest--Extreme Tree  
Random Forest combines N CART decision trees and is trained using the bagging technique.