# Kashif: A Chrome Extension for Classifying Arabic Content on Web Pages Using Machine Learning
## 3 Methodology
### Machine Learning Classifiers
Regularization helps prevent the problem of overfitting by controlling the model's complexity [33]. The hyperparameters and their optimal values for XGBoost are presented in Table 6, where the n_estimator value is 600, the max_depth value is 22, and the gamma parameter specifies the least loss reduction required to make a split, which is 0.5. Furthermore, the learning_rate parameter value is 0.09, representing the weights assigned to the tree in the next iteration. The cosample_bytree parameter value is 0.7, representing the fraction of columns to be randomly sampled for each tree. Moreover, the booster parameter selects the type of model to run at each iteration, and the value 'gbtree' means that the model is tree-based. The cv parameter with the value 5 determines the cross-validation splitting strategy. * DT Classifier DT is a supervised learning technique that can be used for regression and classification problems [34]. Moreover, DT classifier is constructed as a tree-like structure that represents all possible results of a decision based on defined conditions. Furthermore, DT comprises three essential elements: decision nodes (internal nodes), branches, and leaf nodes. The \begin{table}
\begin{tabular}{l l} \hline \hline
**Parameters** & **Optimal Values Obtained** \\ \hline n\_estimators & 600 \\ \hline max\_depth & 22 \\ \hline gamma & 0.5 \\ \hline learning\_rate & 0.09 \\ \hline cosample\_bytree & 0.7 \\ \hline booster & ‘gbtree’ \\ \hline cv & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Grid parameters of XGBoost classifier. \begin{table}
\begin{tabular}{l l} \hline \hline  & **Optimal Values Obtained** \\ \hline random\_state & 42 \\ \hline n\_estimators & 1400 \\ \hline max\_features & ‘auto’ \\ \hline max\_depth & 18 \\ \hline criterion & ‘entropy’ \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Grid parameters of RF classifier. data are branched into two distinct categories, with each internal node representing an attribute. This is repeated until a class label, represented by a leaf, is reached. Table 7 presents the hyperparameters and their optimal values for DT. The max_depth is 30, the max_features is auto, and the criterion value is entropy. The ccp_alpha parameter, with a value of 0.001, refers to the cost complexity parameter that provides another option for controlling the tree size. The greater the value of ccp_alpha, the more nodes are pruned. SVM Classifier  
SVM is a supervised learning algorithm that can solve classification and regression problems. It utilizes a dataset in which the input samples are separated into two classes with labels 0 or 1. The algorithm aims to find a line or plane, known as a hyperplane, that will most efficiently divide the two classes [35]. \[\text{B0}+(\text{B1}\times\text{X1})+(\text{B2}\times\text{X2})=0\]  
The above equation represents the hyperplane equation which can be used to find whether the new example falls in class 0 or 1 side. The coefficients (B1 and B2) give the slope of the line, and the algorithm calculates the intercept (B0). X1 and X2 are the two input data points [35]. The hyperparameters and their optimal values for SVM are presented in Table 8. The first parameter is gamma, with a value of 0.01, which sets the distance of influence of a single training point. Near points will affect classification if the gamma value is high. In other words, the data points must be close to each other to be considered in the same class. However, if the gamma value is low, distant data points will influence the classification, which results in more data points being grouped. The second parameter is the kernel function parameter, with the value of rbf, which is used to transform non-linearly separable data into linearly separable one using the radial basis function (RBF). The third parameter is the C parameter, which defines how much misclassification of the training data is permitted in the model. If the C value is small, the decision boundary with a large margin will be chosen.