You are on page 1of 13

STOCK PRICE

PREDICTION
By Ritik Mitra & Vedant Pai
Module that we will be using
 Pandas : pandas is a fast, powerful, flexible and easy to use open source data analysis and

manipulation tool, built on top of the Python programming language.

 Numpy : NumPy brings the computational power of languages like C and Fortran to Python, a language

much easier to learn and use. With this power comes simplicity: a solution in NumPy is often clear and elegant.

 Matplotlib : matplotlib.pyplot is a plotting library used for 2D graphics in python

programming language. It can be used in python scripts, shell, web application servers

and other graphical user interface toolkits.

 Sklearn : A Python module called Scikit-learn offers a variety of supervised and unsupervised

learning techniques. It is based on several technologies you may already be acquainted with,

including NumPy, pandas, and Matplotlib.


Stock Price Prediction with Data Science

 What are stocks?

Definition:

A stock is a general term used to describe the ownership certificates of any company. A share, on the other hand, refers to the

stock certificate of a particular company. Holding a particular company's share makes you a shareholder.

Description:

Stocks are of two types—common and preferred. The difference is while the holder of the former has voting rights that can be

exercised in corporate decisions, the later doesn't. However, preferred shareholders are legally entitled to receive a certain level of

dividend payments before any dividends can be issued to other shareholders.

There is also something called 'convertible preferred stock'. This is basically a preferred stock with an option of converting into a

fixed number of common shares, usually any time after a predetermined date.
How to Compare Common and Preferred Stock?

COMMON STOCK
■ One main difference from common stock is that preferred stock comes with no voting rights. So when it comes time for a company to elect a
board of directors or vote on any form of corporate policy, preferred shareholders have no voice in the future of the company. In fact,
preferred stock functions similarly to bonds since with preferred shares, investors are usually guaranteed a fixed dividend in perpetuity.
■ The dividend yield of a preferred stock is calculated as the dollar amount of a dividend divided by the price of the stock. This is often based
on the par value before a preferred stock is offered. It's commonly calculated as a percentage of the current market price after it begins
trading. This is different from common stock, which has variable dividends that are declared by the board of directors and never guaranteed.
In fact, many companies do not pay out dividends to common stock at all.
■ Like bonds, preferred shares also have a par value which is affected by interest rates. When interest rates rise, the value of the preferred stock
declines, and vice versa. With common stocks, however, the value of shares is regulated by demand and supply of the market participants.
■ In a liquidation, preferred stockholders have a greater claim to a company's assets and earnings. This is true during the company's good times
when the company has excess cash and decides to distribute money to investors through dividends. The dividends for this type of stock are
usually higher than those issued for common stock. Preferred stock also gets priority over common stock, so if a company misses a dividend
payment, it must first pay any arrears to preferred shareholders before paying out common shareholders.
■ Unlike common shares, preferreds also have a callability feature which gives the issuer the right to redeem the shares from the market after a
predetermined time. Investors who buy preferred shares have a real opportunity for these shares to be called back at a redemption rate
representing a significant premium over their purchase price. The market for preferred shares often anticipates callbacks and prices may be
bid up accordingly.
PREFERRED STOCK

■ Common stock represents shares of ownership in a corporation and the type of stock in which most people invest. When people talk about
stocks, they are usually referring to common stock. In fact, the great majority of stock is issued in this form.
■ Common shares represent a claim on profits (dividends) and confer voting rights. Investors most often get one vote per share owned to
elect board members who oversee the major decisions made by management. Stockholders thus have the ability to exercise control over
corporate policy and management issues compared to preferred shareholders.
■ Common stock tends to outperform bonds and preferred shares. It is also the type of stock that provides the biggest potential for long-term
gains. If a company does well, the value of a common stock can go up. But keep in mind, if the company does poorly, the stock's value
will also go down.
■  The first common stock ever issued was by the Dutch East India Company in 1602.
■ Preferred shares can be converted to a fixed number of common shares, but common shares don't have this benefit.
■ When it comes to a company's dividends, the company's board of directors will decide whether or not to pay out a dividend to common
stockholders. If a company misses a dividend, the common stockholder gets bumped back for a preferred stockholder, meaning paying the
latter is a higher priority for the company.
■ The claim over a company's income and earnings is most important during times of insolvency. Common stockholders are last in line for
the company's assets.1 This means that when the company must liquidate and pay all creditors and bondholders, common stockholders
will not receive any money until after the preferred shareholders are paid out.
WHAT IS DECISION TREE REGRESSION?
■ Decision Tree is a decision-making tool that uses a flowchart-like tree structure or is a model of decisions
and all of their possible results, including outcomes, input costs, and utility.

■ Decision-tree algorithm falls under the category of supervised learning algorithms. It works for both
continuous as well as categorical output variables.

■ The branches/edges represent the result of the node and the nodes have either:

■  

■ Conditions [Decision Nodes]

■ Result [End Nodes]

■ The branches/edges represent the truth/falsity of the statement and take makes a decision based on that in the
example below which shows a decision tree that evaluates the smallest of three numbers:
WHAT IS DECISION TREE REGRESSION?
WHAT IS DECISION TREE REGRESSION?

Decision tree regression observes features of an object and trains a model in the structure of a tree to
predict data in the future to produce meaningful continuous output. Continuous output means that the
output/result is not discrete, i.e., it is not represented just by a discrete, known set of numbers or values.
 
Discrete output example: A weather prediction model that predicts whether or not there’ll be rain on a
particular day.
Continuous output example: A profit prediction model that states the probable profit that can be
generated from the sale of a product.
Here, continuous values are predicted with the help of a decision tree regression model.
WHAT IS LINEAR REGRESSION?

• Linear Regression is a machine learning algorithm based on supervised learning. It performs a


regression task. Regression models a target prediction value based on independent variables. It is
mostly used for finding out the relationship between variables and forecasting. Different regression
models differ based on – the kind of relationship between dependent and independent variables they
are considering, and the number of independent variables getting used. There are many names for a
regression’s dependent variable. It may be called an outcome variable, criterion variable,
endogenous variable, or regressand. The independent variables can be called exogenous variables,
predictor variables, or regressors.
• Linear regression performs the task to predict a dependent variable value (y) based on a given
independent variable (x). So, this regression technique finds out a linear relationship between x
(input) and y(output). Hence, the name is Linear Regression. In the figure above, X (input) is the
work experience and Y (output) is the salary of a person. The regression line is the best fit line for
our model.
WHAT IS LINEAR REGRESSION?
CONCLUSION
USING LINEAR USING DECISION TREE REGRESSION
REGRESSION

Our Result tells us using Decision Tree Regression we can get more accurate
results.
REFERENCE LINKS

■ https://code.visualstudio.com/
■ https://www.geeksforgeeks.org/
■ https://docs.python.org/
■ https://medium.com/
■ https://www.wikipedia.org/
■ https://www.kaggle.com/
THANK YOU

You might also like