# Unleashing the Power of Tweets and News in Stock-Price Prediction Using Machine-Learning Techniques
## 5 Results and Discussion
### Comparing the MLP and LSTM Models  
To thoroughly analyze the MLP and LSTM models' performance, we evaluate the mean and variance of the RMSE across various groupings for each model. The corresponding outcomes are presented in Table 10. Table 10 illustrates that the MLP consistently outperformed the LSTM across all subsets, showcasing lower RMSE values. Additionally, the MLP models demonstrated a lower CV, averaging 0.1693. Despite the LSTM being more complex than the MLP, it failed to surpass the MLP in price prediction accuracy. This finding is in line with the literature, such as the work of [PERSON] et al. (2017), who also found that their LSTM model did not outperform their MLP model for stock-price prediction over a 400-day period. However, when tested over a 10-year period, the LSTM exhibited improved accuracy and outperformed the MLP model--this was mainly attributed to its memory feature. In other words, the memory feature is a key advantage of LSTMs that becomes more beneficial in larger test sets. The intuition behind this phenomenon lies in the increased prediction period, which allows for more opportunities for memory utilization. Consequently, the enhanced complexity of the LSTM proves advantageous in longer prediction periods; however, the same is not true in shorter testing periods. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Company** & \multicolumn{3}{c}{**Mean TC**} & \multicolumn{3}{c}{**Mean NC**} \\ \cline{2-7}  & **Train** & **Nor-Test** & **Pan-Test** & **Train** & **Nor-Test** & **Pan-Test** \\ \hline
1 & Ford & 212 & 131 & 149 & 253 & 334 & 336 \\
2 & Google & 4320 & 3560 & 3140 & 1206 & 1109 & 1237 \\
3 & Netflix & 1823 & 1077 & 907 & 620 & 956 & 730 \\
4 & Facebook & 686 & 866 & 780 & 4758 & 1914 & 1741 \\
5 & Amazon & 3515 & 1816 & 1734 & 727 & 1035 & 890 \\
6 & Apple & 6229 & 1612 & 1675 & 2479 & 2864 & 2735 \\
7 & Walmart & 881 & 394 & 388 & 364 & 439 & 429 \\
8 & Tesla & 2499 & 1395 & 1548 & 488 & 823 & 930 \\ \hline \multicolumn{7}{c}{Top 50\%} & 1760 & 1408 & 1244 & 1709 & 1078 & 1011 \\ \multicolumn{7}{c}{Bottom 50\%} & 3281 & 1304 & 1337 & 1015 & 1290 & 1246 \\ \hline \multicolumn{7}{c}{Top 50\%} & Train vs. Avg Test & 75\% & \multicolumn{3}{c}{Top 50\%} & Train vs. Avg Test & 61\% \\ \multicolumn{7}{c}{Bottom 50\%} & Train vs. Avg Test & 40\% & \multicolumn{3}{c}{Bottom 50\%} & Train vs. Avg Test & 125\% \\ \hline \hline \end{tabular}
\end{table} 
Table 9: The mean TC and NC in the training data, the normal test set, and the panic test set. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Company** & \multicolumn{3}{c}{**Mean TC**} & \multicolumn{3}{c}{**Mean NC**} \\ \cline{2-7}  & **Train** & **Nor-Test** & **Pan-Test** & **Train** & **Nor-Test** & **Pan-Test** \\ \hline
1 & Ford & 212 & 131 & 149 & 253 & 334 & 336 \\
2 & Google & 4320 & 3560 & 3140 & 1206 & 1109 & 1237 \\
3 & Netflix & 1823 & 1077 & 907 & 620 & 956 & 730 \\
4 & Facebook & 686 & 866 & 780 & 4758 & 1914 & 1741 \\
5 & Amazon & 3515 & 1816 & 1734 & 727 & 1035 & 890 \\
6 & Apple & 6229 & 1612 & 1675 & 2479 & 2864 & 2735 \\
7 & Walmart & 881 & 394 & 388 & 364 & 439 & 429 \\
8 & Tesla & 2499 & 1395 & 1548 & 488 & 823 & 930 \\ \hline \multicolumn{7}{c}{Top 50\%} & 1760 & 1408 & 1244 & 1709 & 1078 & 1011 \\ Bottom 50\% & 3281 & 1304 & 1337 & 1015 & 1290 & 1246 \\ \hline \multicolumn{7}{c}{Top 50\%} & Train vs. Avg Test & 75\% & \multicolumn{3}{c}{Top 50\%} & Train vs. Avg Test & 61\% \\ \multicolumn{7}{c}{Bottom 50\%} & Train vs. Avg Test & 40\% & \multicolumn{3}{c}{Bottom 50\%} & Train vs. Avg Test & 125\% \\ \hline \hline \end{tabular}
\end{table} 
Table 8: The variable CV change between the training and test sets. As discussed regarding leveraging MLP and LSTM techniques, we examined factors influencing stock-price prediction accuracy, particularly non-technical variables such as Twitter and news-related data. In other words, we investigated how incorporating these variables impacts prediction performance in normal and panic market conditions.