# Stock Market Prediction Using Microblogging Sentiment Analysis and Machine Learning
## 5 Conclusions  
### Discussion  
In this study, we addressed the subject of SMP utilizing ML approaches with SA. We experimented with Twitter and StockTwits, as well as financial data. Two SA tools, TextBlob and VADER, were utilized to analyze the sentiment of microblogging data. The novelty of this approach can be attributed to the integration of multiple SA and ML methods. We also highlight the importance of SM microblogging data and public sentiment as extra features for SMP. After performing data preprocessing, we assessed our model's performance in four situations (TextBlob with either Twitter or StockTwits data, and VADER with either Twitter or StockTwits data) using seven ML algorithms, including KNN, SVM, LR, NB, DT, RF, and MLP. The model was evaluated using two metrics: the F-score and the AUC. The actual prediction power was evaluated from 10 October 2020 to 31 October 2020, demonstrating possible real-world consequences for forecasting Microsoft's stock price movement.  
According to Table 12, when utilizing the 'StockTwits with TextBlob' dataset, SVM performs best with an F-score of 68.7% and an AUC of 53.3%. This algorithm's prediction was correct for ten days, during which stock values climbed.  
Utilizing the 'StockTwits with VADER' dataset, SVM and LR produced the best F-score (68%) and predictive ability (the prediction was right for 10 days, projecting that Microsoft stock prices would rise). Furthermore, these algorithms produced high AUC values: 55% for SVM and 54.75% for LR, respectively.  
When using the 'Twitter with TextBlob' dataset, SVM got the highest F-score (75%), effectively predicting the outcome for 13 days. However, RF with an F-score of 69.6% appears to produce the most accurate forecasts, as it anticipated properly that for 16 days, the stock prices would rise. Moreover, KNN and DT have the highest discriminating power, with AUC scores of 68% and F-scores of 72%.  
Finally, while employing the 'Twitter with VADER' dataset, SVM demonstrated the greatest F-score (76.3%) and AUC (67%). Admittedly, SVM provided the most accurate forecasts throughout a 15-day period, during which the anticipated prices climbed.  
To summarize, the utilization of Twitter data, and specifically the 'Twitter with VADER' dataset, yielded the highest predictive (F-score, 76.3%) and second best discriminating power (AUC, 67%). This suggests that our model can forecast the true-positive and true-negative points properly. The 'Twitter with TextBlob' dataset has the second greatest overall  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **Training Time (s)** & **Validation Time (s)** \\ \hline KNN & 4.34 & 1.12 \\ SVM & 3.55 & 0.89 \\ LR & 2.26 & 0.45 \\ NB & 6.23 & 2.31 \\ DT & 9.89 & 2.98 \\ RF & 10.29 & 3.13 \\ MLP & 21.23 & 9.11 \\ \hline \hline \end{tabular}
\end{table}
Table 11: Average training and validation time for all models.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Dataset** & **Method/F-Score** & **Method/AUC** \\ \hline ‘StockTwits with TextBlob’ & SVM/68.7\% & SVM/53.3\% \\ ‘StockTwits with VADER’ & SVM \& LR/68\% & SVM/55\% \\ ‘Twitter with TextBlob’ & SVM/75\% & KNN \& DT/68\% \\ ‘Twitter with VADER’ & SVM/76.3\% & SVM/67\% \\ \hline \hline \end{tabular}
\end{table}
Table 12: Best results per dataset.  
predictive power, with an F-score of 75% utilizing the SVM algorithm and an AUC value of 68% utilizing the KNN and DT algorithms. As a consequence, it was determined that the Twitter dataset produced findings with the greatest overall values for F-score and AUC. Lastly, Microsoft stock price movements were accurately anticipated to rise on the majority of days.