Importing All The Necessary Libraries - Transcript
Importing All The Necessary Libraries - Transcript
Welcome to this
Hands on Guided project on Tesla Stock price prediction using
Facebook Prophet. My name is Abhishek and I will be
your instructor for this project.
I'm an engineer and I love solving real world problems using
technology and data science.
My vision is to make technology is so simple that anyone
can understand it.
This project is for anyone who is interested
in machine learning or
time-series forecasting. We will be forecasting the stock price
of Tesla 30 days into the future.
And then we are going to automate the entire forecasting
process for other stocks.
In order to make this project easier to learn.
I have divided the project into tasks.
Each task is very carefully created and designed to give you
the best learning experience.
We will be using the rhyme interface for our guided project.
Rhyme is an interactive cloud deskstop that gives you
the interface to learn hands on by writing the code yourself.
The window screen on your right hand side is for lectures
where I will be working and the bigger one on your left hand
side is your workbook or cloud desktop
where you will be writing the codes.
You can pause the video at any time to write the code
and resume once it is completed, and you can also change
the playback speed according to your comfort.
We will be using Google Colab as our notebook.
You can see a Google Colab notebook open on a virtual
browser.
You can also access this page by going to
colab.research.google.com.
We will need a Google account in order to sign in into Google
Colab.
If you don't have a Gmail account, you'll be prompted
to create one.
The best thing about Google Colab is that most
of the libraries are preinstalled, which means we do not need
to go through the hassle of installing them one by one.
Another benefit of Google Colab notebook is the benefit
of the cloud.
The notebook is saved real time on Google drive from where
you can access it anytime, anywhere.
And the most important feature of Google Colab notebook is
the availability of GPU, which is awesome for machine
learning and deep learning projects.
It makes the computation very fast and efficient.
That means huge computations can be performed within seconds.
The cloud desktop is extremely safe and secure.
The notebook will be saved in your drive in real time.
So since we have a lot to cover, let's begin.
So over here you can see the "sign-in" button,
let's click on it, and you will need your Google credentials in order
to sign in.
And if you don't have a Google account, you can always
click on "Create account" and create a brand new Google
account.
So what I want you to do now is I want you to pause this video
and I want you to sign in into Google.
And I'm going to pause this video and I'm going to sign in
into Google as well.
Welcome back.
As you can see, I've signed in into Google and hopefully
have signed in as well.
So please click on "File" and please click on "upload notebook",
and over here, click on "upload", if it is not
selected automatically.
So I've created a learner notebook for you, and it is saved
on "project files".
So now we're going to upload that notebook. So please click
can "choose file", and in "project files", you can find
this learner notebook.
Click on "Open".
It's uploading, and we have imported this learner notebook
into Google Colab.
Now, before we start our project, we need to switch to GPU
mode for faster computation.
So please click on "run time" and "change runtime type"
and please click over here to know more about it.
So here you can read about and research about GPU and its
benefits.
So let's go back to our "learner notebook" and let's click
on "GPU" and let's click on "Save" and now Click on "Connect".
So it's connecting and our notebook has been connected to the GPU Mode.
So now we are going to import our libraries.
So for those of you who are new to python, libraries are
basically just a chunk of codes that makes life easier
for you.
You don't need to write every single line of code
every single time.
You can just import the libraries and it's done.
And the best part about the Google Colab notebook is that
you don't need to install these libraries.
You can just import them.
So we are going to import pandas.
We're going to import Facebook Prophet, and we are going
to import plotly express. Now, Pandas is a very fast,
powerful, flexible, easy and open source data analysis
and manipulation tool. We will basically be using pandas to read
our data and to manipulate our data.
Facebook Prophet is going to be the algorithm
in order to forecast the stock price and plotly express is
a data visualization library.
In fact, plot we express is a very high level data
visualization library through which we can create graphs
with just one line of code, and the quality of graphs are
excellent.
So now let's import our libraries.
So please click on this cell and let's start importing our libraries.
"Import pandas as pd"
and we're going to import pandas as pd.
Now we're going to
"import plotly.express as px"
and we are going to import Facebook Prophet.
from prophet import Prophet
Python is case sensitive.
So please make sure this "P" is capitalized.
So these are all the libraries that will be working with.
"Pandas" for data manipulation and "plotly express" for data visualization
and "Facebook Prophet" for forecasting.
Now plotly
is already pre-installed in Google Colab.
Plotly consumes a lot of computing power.
So it's default mode is "off" in Google Colab.
So we need to initialize it in order to operate it, and
that's what we're going to do now.
So let's initialize plotly. So we can initialize plotly by
using the following syntax.
"import plotly.io as pio"
"pio.renderers.default = 'colab'
Let's set this to Colab.
That's all we need to do in your order to initialize it.
So now let's run this cell. So you can click over here to run
the cell or you can click on "control/Shift + Enter" to run the cell.
So both of the cell has been run and we have
successfully imported all our necessary libraries, and we
have initialized plotly.
So that's all for this task in this task we imported all the
necessary libraries and in the next task we will import our dataset.
See you in the next task.