1 of 32

PREDICTING STOCK MARKET USING PSYCHO- LINGUISTIC FEATURES OF NEWS

Presentation by-

Smriti Agrawal (S050)

Rabjot Sethi (S058)

2 of 32

3 of 32

INTRODUCTION

    • News availability has increased dramatically.
    • An automated system to predict future stock prices will be helpful for investors.
    • Some of the previous works used Twitter sentiments, financial blogs, or news articles as the textual data.
    • News articles from well-known sources to avoid fake news that may be prevalent on social media.
    • Taking into consideration the news of a company instead of only considering the past stock prices leads to better results.

​

​

4 of 32

METHODOLOGY

    • DATA CLEANING & PREPROCESSING
    • TEXT PREPROCESSING
    • SENTIMENT ANALYSIS
    • VISUALIZATIONS
    • MODEL BUILDING

5 of 32

ABOUT OUR DATASET

    • Sourced from Kaggle.
    • Contains historical news headlines from various News Channels, ranked by reddit users' votes.
    • The top 25 headlines are considered for a single date for 8 years.
    • Contains the Stock Data of Dow Jones Industrial Average along with binary classification labels.

1 - increases

0- no change or decreases

    • 1989 datapoints.

​

6 of 32

7 of 32

DATA CLEANING & PREPROCESSING

1989 rows x 27 columns

DIMENSION

7 Values

MISSING VALUES

Label

Increase - 1

No change or decrease - 0

TARGET VARIABLE

8 of 32

    • Tokenizing the text into individual words.
    • Converting all words to lowercase.
    • Stemming or lemmatizing the words.
    • Removing punctuation.
    • Removing stopwords.
    • Removing non-textual data (e.g. URLs, numbers, special characters).
    • Removing words that are unique to the corpus or dataset.

​

​

“TO PREPROCESS YOUR TEXT SIMPLY MEANS TO BRING YOUR TEXT INTO A FORM THAT IS PREDICTABLE AND ANALYZABLE FOR YOUR TASK.”

TEXT PREPROCESSING

9 of 32

    • Sentiment analysis extracts the polarity and negativity, subject and opinion holder within the text.
    • Polarity - It involves determining the emotional tone or sentiment conveyed in text data.
    • Subjectivity - It quantifies the amount of personal opinion and factual information contained in the text.
    • Polarity Scores - Indicate the strength or intensity of sentiment expressed in text and represent the degree of positive, negative, or neutral sentiment.

​

​

SENTIMENT ANALYSIS

SENTIMENT ANALYSIS, ALSO REFERRED TO AS OPINION MINING, IS AN APPROACH TO NATURAL LANGUAGE PROCESSING (NLP) THAT IDENTIFIES THE EMOTIONAL TONE BEHIND A BODY OF TEXT.

10 of 32

11 of 32

Visualization

12 of 32

CORRELATION

13 of 32

VOLATILITY OF INDEX

14 of 32

15 of 32

CANDELSTICK CHART

16 of 32

GENERAL WORDCLOUD

17 of 32

WORDCLOUDS DEPICTING RISE & FALL IN DJIA

18 of 32

Model Building

19 of 32

    • UNDER SUPERVISED LEARNING.
    • USED FOR PREDICTING THE CATEGORICAL DEPENDENT VARIABLE.
    • IT CAN BE EITHER YES OR NO, 0 OR 1, TRUE OR FALSE, ETC.
    • IT GIVES THE PROBABILISTIC VALUES WHICH LIE BETWEEN 0 AND 1.

LOGISTIC REGRESSION

20 of 32

    • USED FOR BINARY CLASSIFICATION TASKS.
    • SUPPORT VECTORS ARE THE DATA POINTS THAT ARE CLOSEST TO THE HYPERPLANE.
    • PLAYS A CRITICAL ROLE IN DETERMINING THE OPTIMAL HYPERPLANE.
    • SEPARATES CLASSES WHILE MINIMIZING CLASSIFICATION ERRORS.

SUPPORT VECTOR CLASSIFIER

21 of 32

    • USED FOR BOTH CLASSIFICATION AND REGRESSION TASKS.
    • AN ENSEMBLE METHOD THAT COMBINES MULTIPLE DECISION TREES TO MAKE PREDICTIONS.
    • BUILDS A "FOREST" OF DECISION TREESWHICH ARE TRAINED ON A RANDOM SUBSET OF THE TRAINING DATA AND FEATURES AT EACH SPLIT.
    • REDUCES OVERFITTING

RANDOM FOREST

22 of 32

    • COMBINES MULTIPLE WEAK PREDICTIVE MODELS TO CREATE A STRONGER AND MORE ACCURATE MODEL.
    • ITERATIVELY BUILDS A SEQUENCE OF WEAK MODELS, EACH ONE TRAINED TO PREDICT THE RESIDUAL ERRORS.
    • GRADIENT OF THE LOSS FUNCTION WITH RESPECT TO THE PREDICTED VALUES IS CALCULATED.

GRADIENT BOOSTING

23 of 32

    • SIMPLE AND INTUITIVE.
    • MAKES PREDICTIONS BASED ON THE NEAREST NEIGHBORS IN THE TRAINING DATA.
    • THE "CLOSENESS" IS TYPICALLY DETERMINED BY A DISTANCE METRIC.
    • MEASURES THE SIMILARITY OR DISSIMILARITY BETWEEN DATA POINTS IN THE FEATURE SPACE.

K-NEAREST NEIGHBOUR

24 of 32

    • A FLOWCHART-LIKE STRUCTURE .
    • IT SPLITS THE DATA BASED ON FEATURE VALUES TO CREATE A PREDICTIVE MODEL.
    • SPLITTING IS BASED ON CRITERIA LIKE ENTROPY OR GINI IMPURITY THAT MEASURE DATA IMPURITY.

​

DECISION TREE

25 of 32

Stocks

Probability

Apple Inc.

0.630228

Microsoft Corporation

0.125937

Walmart

0.037588

JP Morgan Chase

0.839561

Goldman Sachs

0.824673

STOCKS AND MARKETING

26 of 32

F1 Scores

Model

F1 Score

Logistic Regression

55.98%

Support Vector Classifier

68.55%

Random Forest

64.83%

Gradient Boosting

60.13%

K-Nearest Neighbour

46.70%

Decision Tree

52.40%

27 of 32

HYPERPARAMETER TUNING

    • Refers to the process of finding the optimal values for hyperparameters in a machine learning model.
    • Hyperparameters are configuration settings that are not learned from the data during model training, but rather set prior to training and affect the behavior and performance of the model.

F1-SCORE INCREASED FROM 68.55% TO 69.29%

28 of 32

    • Add data for more indices of multiple countries which will help us to get a hold on international dependency of financial markets and check the prediction accuracy.
    • Algorithmic trading.
    • valuable market information has now become publicly available online which can be used to analyze market data.
    • Additionally, feature engineering could be performed to extract more relevant information from the data.
    • In the future user friendly softwares can be developed which will be providing a highly accurate prediction based on sentiment analysis

FUTURE WORK

29 of 32

    • Limited size of the dataset, which may not be representative of the true underlying distribution of the data.
    • Only a limited models were evaluated, and there may be other models that could be performed better on this dataset.
    • The high volatility of the stock market can make challenging to accurately predict and model stock market movements.
    • Time and resource constraints.
    • Lack of control over external factors.

LIMITATIONS

30 of 32

CONCLUSION

In this project, several machine learning models were applied to a binary classification problem. The models included Logistic Regression, Support Vector Classifier (SVC), Random Forest, Gradient Boosting, K-Nearest Neighbors, and Decision Tree. The evaluation of these models was performed using various metrics such as accuracy, precision, recall, and F1 score.

Based on the results, the SVC model showed the best performance with an F1 score of 68.55%. The accuracy, precision, and recall were also relatively high compared to the other models. As a result, further tuning of the hyperparameters for the SVC model was performed to improve its performance.

​

31 of 32

ACKNOWLEDGEMENT

We are grateful to our respectable professor, Mr. Amit Gawade, Mr. Anurag Nigam & Dr. Megha Jain, whose insightful leadership and knowledge benefited us to complete this project successfully. Thank you so much for your continuous support and presence whenever needed.

​

All in all, we would like to thank everyone involved in this project directly or indirectly and helped us with their suggestions to make the project better.

​

32 of 32

THANK YOU!