# Hybrid RFSVM: Hybridization of SVM and Random Forest Models for Detection of Fake News
## 3 Implementation and Results  
The authors implemented the project in Python, and considered data on fake news about COVID-19 from X (Twitter). All packages like XGBClassifier and Random Forest Classifier were imported from the sklearn library in Python. In total, 60% of the data were training data and 40% of the data were testing data. The dataset was read using the read_csv method using the panda package. Authors considered TFIDF [22] as a feature set. TF computes the weight and the frequency of every term occurring in a document. \[TF(w,j)=\frac{Frequency\ of\ w\ in\ document}{Total\ number\ of\ w\ in\ document} \tag{5}\]  
IDF computes the importance of each term w. In sklearn, IDF(t) is  
\[IDF\ (t)=Log\ \frac{1+n}{1+df(t)}+1 \tag{6}\]  
The evaluation parameters were determined using naive Bayes, XGBoost, Support Vector Machines, and Random Forest. For text classification issues, naive Bayes classifiers are a quick and effective option. They can easily be trained on small datasets. Support Vector Machines tend to give more accurate results on concise datasets and handle high-dimensional spaces efficiently. Random Forest works on large datasets efficiently and produces very accurate results. The XGBoost classifier is scalable to large datasets and produces optimized and efficient computational performance [30]. It also handles sparse data. Table 2 shows the abbreviations used for machine-learning classifiers. Figure 4 and 5 show the accuracy % and precision % for five different classification algorithms, respectively. Naive Bayes has the lowest accuracy %, and hybrid SVMs and Random Forest have the highest accuracy %. SVMs have a precision of 86.91%, RF has 84.88%, and XGBoost has 84.56%. Figures 6 and 7 show the recall % and F1-score % of NB, RF, SVMs, XGBoost, and RFSVM, respectively. RFSVM has the highest recall at 92.30% and XGBoost has the lowest recall at 83.90%. RFSVM has the highest F1-score at 93.50%. \begin{table}
\begin{tabular}{l l} \hline Support Vector Machine + Random Forest & RFSVM \\ \hline Support Vector Machine & SVM \\ \hline Random Forest & RF \\ \hline XGBoost & XGB \\ \hline Naive Bayes & NB \\ \hline \end{tabular}
\end{table} 
Table 2: Abbreviations used for classifiers. Figure 4: Accuracy % of artificial intelligence algorithms. Figure 5: Precision % of artificial intelligence algorithms. Figure 6: Recall % of artificial intelligence algorithms. Figure 7: F1-score % of artificial intelligence algorithms. The results have shown that the RFSVM excels in various parameters with an accuracy of 97.56%, precision of 88.21%, recall of 92.30%, and F1-score of 93.50%, compared to the results of naive Bayes, Random Forest, SVMs and XGBoost. This means that 92.30% (maximum recall) of fake news was detected successfully with our proposed methodology. Table 4 shows the comparison among various machine-learning classification algorithms in terms of accuracy, precision, recall, and F1-score. SVMs show better accuracy than naive Bayes, Random Forest, and XGBoost, as naive Bayes treats features as independent features and SVMs explore the relationship between independent features to a certain degree, and a nonlinear kernel is used as Gaussian. The output therefore varies depending on the features of problem statement interaction and prediction models. SVMs are better than naive Bayes. The prediction function shows dependencies between variables that naive Bayes (y (a, b) = ab) does not catch, so it is not a universal approximator. As SVMs utilize kernel trick and maximum margin principle to work better in nonlinear and high-dimensional tasks, SVMs are the best algorithm of all. It also benefits from the correct set of features and extraction/transformation techniques much of the time. Figure 8 shows the graphical comparison among various parameters. Table 5 shows that the hybrid approach of SVMs and Random Forest outperforms others with an accuracy of 0.9756. Different categories of fake news may be evaluated with five different models in terms of accuracy, precision, and F1-score.