0% found this document useful (0 votes)
17 views7 pages

Reserach Report

This document describes a machine learning project that aims to analyze the impact of news articles on stock market prices. It involves the following key steps: 1. Loading news articles and stock ticker data. 2. Preprocessing the news articles data by removing blank descriptions, tokenizing text, and matching company names in the news to stock tickers. 3. Retrieving historical stock price data corresponding to the matched ticker symbols for a period before and after each news article date. 4. Calculating the impact of each news article by comparing stock prices before and after to analyze how news affects stock prices. The goal is to build a model that can forecast stock price changes based on analyzing the relationship between

Uploaded by

Aaditi Bisht
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views7 pages

Reserach Report

This document describes a machine learning project that aims to analyze the impact of news articles on stock market prices. It involves the following key steps: 1. Loading news articles and stock ticker data. 2. Preprocessing the news articles data by removing blank descriptions, tokenizing text, and matching company names in the news to stock tickers. 3. Retrieving historical stock price data corresponding to the matched ticker symbols for a period before and after each news article date. 4. Calculating the impact of each news article by comparing stock prices before and after to analyze how news affects stock prices. The goal is to build a model that can forecast stock price changes based on analyzing the relationship between

Uploaded by

Aaditi Bisht
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Impact Analysis of Stock Market

Aaditi Bisht Mansi Bahuguna Samridhi Naithani

Graphic Era deemed to be University Graphic Era deemed to be University Graphic Era deemed to be University

Dehradun , India Dehradun, India Dehradun, India

[email protected] [email protected] [email protected]

Abstract
prices in order to make wise investment choices and
In this project, machine learning is be used to analyse reduce risks. However, given the enormous amount of
how news articles may affect the stock market. By data and intricate dynamics involved, determining the
studying the connection between the news stories and relationship between news events and stock market
changes in company stock prices, the study will performance can be difficult. Using a data-driven
examine the effect of news items on the stock market. methodology, this initiative seeks to give a thorough
The machine learning model for the project will be analysis of the effect of news events on stock market
trained using historical stock prices and news articles. performance. We provide a framework that enables the
The effectiveness of the model will be assessed using analysis of the complex relationship between news
statistical criteria including recall, accuracy, and events and stock prices by combining data processing,
precision. The model will be put to the test on a real- symbol matching, financial data retrieval, machine
time news feed to see how well it can forecast changes learning, and visualisation techniques. We will go over
in stock price. The project's findings will shed light on this analysis's methodology, findings, and consequences
how news affects the stock market and can be used to in the parts that follow, providing you important new
guide investment decisions. Additionally, the project information about the complex connection between
may aid in the creation of more complex machine news events and stock market performance.
learning algorithms for stock market analysis.
Introduction . A wide range of factors can affect stock
prices on the stock market, which is a dynamic and
volatile environment. News, particularly news about the literature survey
businesses and industries whose stocks are traded, is
1. Alexander O'Connor and Christian Rayner's
one of the major factors that might have an impact on
"Predicting Stock Prices from Financial News Articles
the stock market. The use of machine learning
Using Machine Learning and Sentiment Analysis" (2019)
algorithms to examine how news affects the stock
- This research discusses a machine learning method
market has gained popularity in recent years. The goal
that bases stock price predictions on financial news
of this project is to create a system that uses machine
stories using sentiment analysis.
learning to analyse how news affects the stock market.
Contrary to conventional methods that rely on 2. Sahil Gupta and Anubhav Jain's "Machine Learning
sentiment analysis and natural language processing Techniques in Stock Price Prediction" (2019) - This
(NLP), we have employed tokenization and pattern article gives a general review of the machine learning
matching methods coupled with machine learning methods, such as feature extraction, pattern
algorithms to analyse news stories and forecast their recognition, and prediction models, that are used to
effect on stock market. forecast stock prices.

3. Gaurav Apte and Sharmila Deore's "Stock Price


Prediction Using News Articles" from 2018 - This study
Introduction suggests a machine learning model that forecasts stock
values using sentiment analysis and news articles.
News events have a big impact on financial markets,
particularly the stock market, in today's fast-paced and 4. Yogesh Pise and Kedar Phadke (2018), "Impact of
linked world. Investors, financial analysts, and decision- News on Stock Market Using Machine Learning
makers must understand how news events affect stock Techniques" - This study uses machine learning
methods, such as decision trees and random forests, to 5.Fuzzy String Matching
discuss the effect of news on the stock market.
The script makes use of fuzzy string matching methods
5. Pradeep Kumar and Madhu Sudan's "Stock Market from the fuzzywuzzy library to enhance the matching of
Prediction Using Machine Learning Algorithms" from firm names even further. Even if two strings are not
2018 - This study evaluates the effectiveness of decision exactly the same, fuzzy string matching enables
trees, neural networks, and support vector machines as approximative matching. The fuzz.token_set_ratio()
machine learning methods for stock market forecasting. function is used to compare the common company
names with the firm names in the df2 DataFrame as the
script iterates over each row in the df DataFrame. The
Methodology similarity score between two strings is determined by
this function based on the existence of shared tokens.
The related symbol from df2 is given to the 'Matched
1.Libraries Imported
Symbol' column in the df DataFrame if the similarity
score is greater than a predetermined cutoff (80 in this
The script starts out by importing the required libraries. case). This process aids in connecting the news stories
These libraries offer a range of tools and methods for to particular brand icons.
handling and analysing data. The nltk library is used for
tasks involving natural language processing, the 6. Additional Matching
fuzzywuzzy library is used for fuzzy string matching, and In addition to matching fuzzy strings, the script also
the pandas library is used for data manipulation and matches specific firm names that may not have been
analysis. accurately matched in the past. The 'Matched Symbol'
2.Loading Data column is then filled with the corresponding symbol
once each news item's title has been compared using
The script loads two CSV files: newsfeed - News (5).csv fuzzy string matching to these specified names. This
and ticker.csv. These files likely contain data related to phase makes sure the script includes all pertinent news
news articles and company ticker symbols, respectively. items for a particular organisation.
The data is loaded into DataFrame objects using the
pd.read_csv() function. A DataFrame is a two- 7.Stock Data Retrieval
dimensional data structure that resembles a table, After finding the matching symbols, the script collects
where data is organized in rows and columns. stock information for those symbols. It makes use of the
3.Data preprocessing yfinance and pandas_datareader libraries, which give
users access to financial data from a variety of sources.
Some preprocessing operations are carried out prior to The script iterates over each row in the df DataFrame,
data analysis. For uniformity, the 'Description' column obtains the stock data for a predetermined time frame
in the df DataFrame has been renamed to 'description'. (5 days before and after the news date), and computes
Using the dropna() function, rows with blank values in the average of the 'High' and 'Low' prices. The symbol
the 'Description' column are removed. This makes sure serves as the key to the stock dictionary, which holds
that only accurate and comprehensive data are used for the stock data. The essential stock data is made
additional analysis. The 'Description' column's text has available in this phase so that you may analyse how
been tokenized, or divided into separate words or news affects stock prices.
"tokens," using the nltk.word_tokenize() function. The
text is now ready for further examination. 8.Impact calculation

4.Matching company name a.The script iterates through each row in the df
DataFrame, which contains the matching news items
The script seeks to match the firm names listed in the and their corresponding symbols. a. Iterating through
df2 DataFrame with the company names indicated in Each Row.
the news descriptions. In the df DataFrame, it adds a
new column called "common_company_names" that b. Retrieving Stock Data: The script searches the stock
will hold the matching companies' names as strings. dictionary for the stock data for each news item's
This matching procedure makes it easier to determine matching symbol. This stock data includes the high and
the business a news piece is discussing. low prices for a particular time frame, often 5 days prior
to and 5 days following the news date .
c. Calculating Average values: For the stock data very clear how stock prices changed in response to
obtained in the previous step, the script calculates the various news events. A standard deviation curve was
average of the "High" and "Low" values. The stock price also used to illustrate how stock volatility relates to
before and after the announcement is estimated in this news events. Investors were able to evaluate the
average price. potential impact on their investment thanks to this
visualisation, which showed the degree of uncertainty
1.Retrieve Stock Data: The script pulls the
and risk connected with particular news items.The
corresponding stock data from the stock dictionary for a
intricate relationship between news events and stock
given news story. The opening price, closing price, high
market performance was made clear by the results of
price, low price, and volume traded for a given time
impact analysis, machine learning, and visualisations.
period (for example, the five days before and five days
The framework offered a thorough method for figuring
following the news date) are some of the common
out how news impacts stock prices, revealing trends
details included in this stock data.
and insights that might not have been visible through
2.Calculate Average: The script focuses on the "High" human research alone. These results have significant
and "Low" values of the stock data for simplicity. It ramifications for investors, financial analysts, and
calculates the average value by adding the "High" and decision-makers since they advance our knowledge of
"Low" values together and dividing the sum by 2. This the stock market's dynamics and help us make better
provides an estimate of the stock price before and after investment decisions based on news analysis.
the news announcement.

Average = (High + Low) / 2

The resulting average value represents an


approximation of the stock price during that specific
time period.

Result and Discussion


The framework's impact analysis yielded important
insights into how news events impact stock prices. The
research established if there was a gain, loss, or no
discernible change in stock price as a result of the news
event by comparing the average high and low prices of
a select group of stocks before and after the news date.
These impact metrics demonstrated the degree to
which news events affected stock market
performance .Furthermore, utilising the news data and
ascribed impact scores, machine learning techniques
were used to train a Random Forest Classifier. To
forecast the effect of upcoming news events on stock
prices, this algorithm took advantage of historical
trends. The outcomes of machine learning revealed
correlations and patterns that manual research might
not have instantly picked up on by Investors and
financial analysts can make better decisions and
comprehend the possible effects of news events on
certain equities by utilising these insights. The
framework's visualisations were essential in portraying
stock performance and volatility in response to news
events. In order to identify trends and patterns, line
charts were utilised to depict the closing prices of the
chosen equities over time. These illustrations made it
References
1. "NewsQA: A Machine Comprehension Dataset" by
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield,
Michael Collins, Ankur Parikh, Chris Alberti, Danielle
Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee,
Kristina Toutanova, Llion Jones, Ming-Wei Chang,
Andrew Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov

2. "Event Detection and Tracking for Online Reputation


Management" by Ramanathan Narayanan and William
Cohen.

3. "Predicting the News: Using Text Mining to Predict


Stock Returns" by Tim Loughran and Bill McDonald.

4. "Sentiment Analysis of News Articles Using Hybrid


Machine Learning Approaches" by Giuseppe Castellucci,
Marco Corneli, Alessandro Micarelli, and Fabio
Gasparetti.

5. "Analyzing News Articles for Stock Price Prediction


Using a Multi-Document Neural Attention Model" by
Ziniu Hu, Jie Yang, and Wei Wang.

6. "Topic Modeling for Social Media Data" by Michal


Rosen-Zvi, Chaitanya Chemudugunta, Thomas Griffiths,
and Padhraic Smyth.

7. "News Topic Classification with Multi-Label Learning


Approaches" by Jinseok Kim, Gary Geunbae Lee, and
Hae-Chang Rim.

8. "A Comparative Study of Topic Modeling Techniques


for Twitter Data Analysis" by Leila Sujir, Ioannis
Katramados, and David Saulnier.

CONCLUSION
To sum up, the created framework offers a reliable
method for examining news data, connecting it with
stock symbols, extracting pertinent stock data, and
using machine learning techniques to foretell how news
events would affect stock values. This framework aids in
providing understanding of the intricate connection
between news events and the stock market. The study's
conclusions have consequences for investors, financial
analysts, and decision-makers who need to
comprehend stock market dynamics and make wise
investment decisions based on news research.

You might also like