whatsapp

whatsApp

Have any Questions? Enquiry here!
☎ +91-9972364704 LOGIN BLOG
× Home Careers Contact
Back
Stock Price Prediction using Machine Learning in Python
Stock Price Prediction using Machine Learning in Python

MACHINE LEARNING:proves immensely helpful in many industries in automating tasks that earlier required human labor one such application of ML is predicting whether a particular trade will be profitable or not.

In this article, we will learn how to predict a signal that indicates whether buying a particular stock will be helpful or not by using ML.

 

Let’s start by importing some libraries which will be used for various purposes which will be explained later in this article.

Importing Libraries

Python libraries make it very easy for us to handle the data and perform typical and complex tasks with a single line of code.

  • Pandas – This library helps to load the data frame in a 2D array format and has multiple functions to perform analysis tasks in one go.
  • Numpy – Numpy arrays are very fast and can perform large computations in a very short time.
  • Matplotlib/Seaborn – This library is used to draw visualizations.
  • Sklearn – This module contains multiple libraries having pre-implemented functions to perform tasks from data preprocessing to model development and evaluation.
  • XGBoost This contains the eXtreme Gradient Boosting machine learning algorithm which is one of the algorithms w
  • import numpy as np
  • import pandas as pd
  • import matplotlib.pyplot as plt
  • import seaborn as sb
  •  
  • from sklearn.model_selection import train_test_split
  • from sklearn.preprocessing import StandardScaler
  • from sklearn.linear_model import LogisticRegression
  • from sklearn.svm import SVC
  • from xgboost import XGBClassifier
  • from sklearn import metrics
  • import warnings
  • warnings.filterwarnings('ignore')

Importing Dataset

 

The dataset we will use here to perform the analysis and build a predictive model is Tesla Stock Price data. We will use OHLC(‘Open’, ‘High’, ‘Low’, ‘Close’) data from 1st January 2010 to 31st December 2017 which is for 8 years for the Tesla stocks.

 

df = pd.read_csv('/content/Tesla.csv')

df.head()

 

Exploratory Data Analysis

 is an approach to analyzing the data using visual techniques. It is used to discover trends, and patterns, or to check assumptions with the help of statistical summaries and graphical representations. 

While performing the EDA of the Tesla Stock Price data we will analyze how prices of the stock have moved over the period of time and how the end of the quarters affects the prices of the stock.

 

Note: Find the best solution for electronics components and technical projects  ideas 

keep in touch with our social media links as mentioned below 

Mifratech websites : https://www.mifratech.com/public/ 

Mifratech facebook : https://www.facebook.com/mifratech.lab 

mifratech instagram : https://www.instagram.com/mifratech/ 

mifratech twitter account : https://twitter.com/mifratech 

Contact for more information : mifratech@gmail.com / 080-73744810 / 9972364704 

 
 
Popular Coures