## 4 Experimental Results
### Spam Detection Models and Results  
In natural language processing problems, GRU models are often preferred for their more straightforward structure and ability to capture long-term dependencies in sequential data. A GRU provides more efficient learning by reducing the gradient loss problem in the RNN structure and produces fast and effective results with fewer parameters. Thanks to these advantages, GRU models offer a high performance in text-based classification tasks such as spam. In this study, three different GRU models were developed with 39, 48, and 58 feature inputs. In the first stage, messages were vectorized based on the 10,000 most frequently used words using the tokenizer tool of the Keras library. Message token lengths were set to be two standard deviations more than the dataset's average, and padding was applied to achieve this length. With this method, fixed-size message vectors with 39 elements were obtained. A statistical analysis showed that this length covers and represents approximately 98% of the messages in the dataset. A schematic representation of the GRU models is presented in Figure 3.  
As the first layer of the model, an embedding layer was defined, which generated 50-dimensional word vectors to learn the semantic relationships of words. This layer allowed the words in the text to be represented as low-dimensional density vectors. After the embedding layer, a deep learning model consisting of three GRU layers and one dense layer was constructed. The Adam algorithm optimized the model, and binary cross-entropy was chosen as the loss function. The training was conducted in mini-batches of 256 samples each for 20 epochs. In addition, 9-dimensional or 19-dimensional numerical data were used to provide additional features in the GRU models and to see their impact on classification performance. These numerical features were first linked to a dense layer and then integrated with the output of the final GRU layer through a concatenate layer. This approach allowed the model to process both textual and numeric data together. The pseudo-code for the GRU model used is given in Algorithm 1. Comprehensive experiments were conducted on the GRU spam detection models, which were named depending on the statistical features used. According to the experimental results, the GRU39, GRU58, and GRU48 models achieved a high classification accuracy on the SMS Spam Collection dataset. Table 3 shows the model used in each method, the  
Figure 3: The GRU model. number of features, and the classification accuracy obtained. Among the GRU models, the GRU39 model achieved better success compared to the other models, with a classification accuracy of 98.99%. MLP (multi-layer perceptron) models offer significant advantages in spam classification tasks due to their ability to capture non-linear relationships in the data. This advantage is even more pronounced given the complex language structures and various features of spam messages, which MLPs can model effectively. As with the GRU models, the MLP models were trained and tested using three different datasets: word vectors only, datasets with nine additional statistical features, and datasets with nineteen additional statistical features. In the data preprocessing step, the text data were noise-cleaned by filtering the English stop words. This step allowed the model to focus on more meaningful features by avoiding unnecessary words. The text was vectorized using the CountVectorizer and TF-IDF (Term Frequency-Inverse Document Frequency) methods. While CountVectorizer creates a basic word frequency representation by counting the number of times words occur in documents, the TF-IDF method helps to determine the importance and discriminative power of words in documents. These two methods transformed the text data into numerical vectors that the MLP model could process. To achieve the best performance of the model, a hyperparameter optimization was performed with the GridSearch method.