S.16Machine learningNovember – December 2024shipped

Stock Sentiment Prediction

Six algorithms, one ensemble vote

An NLP system analysing social media sentiment to predict stock market trends, comparing six classifiers head to head and combining them through ensemble voting.

Best model
93.29%
K-Neighbors
Spread
3.6 pts
best to worst
Algorithms
6
combined by voting
Training records
14,000+
sentiment-labelled

Raw text runs through a full NLP preprocessing pipeline — cleaning, tokenization, stop-word removal, lemmatization, then TF-IDF vectorisation with n-gram feature extraction — before being fed to six different classifiers: a deep neural network, SVM, logistic regression, decision tree, K-Neighbors and gradient boosting, combined through a voting ensemble.

K-Neighbors93.29%
Logistic Regression92.31%
Gradient Boosting92.14%
Deep Neural Network91.82%
Decision Tree91%
Support Vector Machine89.69%
Six classifiers on identical features. The interesting result is the spread: 3.6 points separates the best from the worst, which says the features are doing the work, not the model choice.

K-Neighbors came out best at 93.29% accuracy with precision, recall and F1 all at 0.933. But the more useful observation is the narrowness of the field: only 3.6 percentage points separate the best model from the worst, and a KNN beating a deep network on the same features is a strong hint that the TF-IDF representation is carrying the signal and the classifier is close to irrelevant. The ensemble exists for robustness rather than for accuracy.

Search only: every answer quotes this site and links its source. Nothing is generated.