# Social Network Sentiment Analysis Using Hybrid Deep Learning Models
## 4 Experiments and Results
### Optimum Hyperparameter Setting
This method is chosen instead of absolute frequency because the most frequent terms are not always the ones that best discriminate between classes, as a term can appear the same number of times in different classes (P, NONE, and N), so this term would not provide much information. Thus, the \(IG\)[41, 47] of a Tweet word measures the number of bits of information obtained for the prediction of a class (\(C\)) by knowing the presence or absence of a term (\(t\)) in a Tweet. \(IG\) is, thus, a measure that summarises how common a word is in a given class compared to how common the same word is in the other classes of the corpus. To understand the meaning of Information Gain (\(IG\)), suppose we have two words: \(word_{1}\) and \(word_{2}\). If \(word_{1}\) has a higher \(IG\) value than \(word_{2}\), \(word_{1}\) will be more useful in the training of our model because it increases information and reduces uncertainty. To calculate the \(IG\) of a word, we first need to calculate the entropy [45], the formula of which is (1):  
\[H=\sum_{i=1}^{n}p_{i}\cdot\log_{2}(p_{i}) \tag{1}\]  
where \(p_{i}\) is the probability, \(P(w_{i}|c_{i})\), that the word, \(w_{i}\), appears in the class, \(c_{i}\). Then, to calculate the Information Gain (\(IG\)), the formula is (2):  
\[IG(C,X)=H(C)-H(C,X) \tag{2}\]  
where \(C\) is the set of classes and \(X\) is the subset of texts in which the term \(w_{i}\) appears. To know \(H(c)\), we first need to compute the probabilities of each class within the corpus. To know \(H(C,X)\), we need to obtain the probabilities of the word appearing and not appearing in the corpus, as well as the probabilities of appearing and not appearing in each of the corresponding classes. Thus, the concept of \(IG\) is applied in our case to retain the best vocabulary words and to check whether it improves the results of our hybrid classifier model. As can be seen in Table 3, the entropy gain improves the accuracy of the model, and the best result is obtained with a vocabulary size lower than the initial one (nearly 45,000), especially by choosing 10,000 words. Indeed, an accuracy improvement of up to 2.7 percentage points can be observed by integrating the Information Gain (\(IG\)). \begin{table}
\begin{tabular}{c c} \hline \hline
**Vocabulary Size** & **Cross-Validation Accuracy** \\ \hline
5000 & 75.70\% \\
**10,000** & **75.82\%** \\
15,000 & 75.70\% \\
20,000 & 75.58\% \\
45,000 & 73.14\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Summary of test carried out to evaluate the hybrid model using \(IG\). At this point, in order to validate the initial configuration of the hybrid model, tests are carried out to evaluate the values of the hyperparameters related to the size and maximum length of the embedding layer, which indicate the input size of the embedding matrix, with the former indicating the columns and the latter the rows. The stability of the model is evident from Table 4, where no significant variations between different matrix sizes are observed. The optimal outcome is achieved with a dimension value of 200 and a maximum tensor length of 33, which affirms that the initial values used in the preliminary configuration of the model were effective. Finally, the batch size parameter defines the amount of data the model has in each iteration, so it will be analysed how the modification of this value affects the model. The values of Table 5 are typical values used as standards in other models. As can be seen in this table, there are no major differences in terms of accuracy results; however, in execution times, there is a relationship between higher BS values producing shorter execution times, since in each iteration, the model has more data and, therefore, takes less time to process the information. Finally, looking at the accuracy values in Table 5, a BS value of 256 is taken.