Machine Learning in Trading | Importing Data for ML | Trading with ML Regression Models

Опубликовано: 04 Октябрь 2024
на канале: Quantra
853
13

Part of the course on Trading with Machine Learning Regression:
https://quantra.quantinsti.com/course...

In this video, you will learn how to import the required libraries.
First, we import Pandas. Pandas is an open source, BSD licensed library providing, high performance, easy to use data structures, and data analysis tools for the Python programming language. We use an alias, pd, for referencing the entire Pandas library.
Next, we import Numpy. Numpy can be used as an efficient multi-dimensional container of generic data. Arbitrary data-types can be defined. This allows Numpy to seamlessly and speedily integrate with a wide variety of databases. We will use the alias ‘np’ for Numpy.
Both Numpy and Pandas have been covered in detail in “Python for Trading" course, which is a pre-requisite for this course.
Next, we import the pyplot package from Matplotlib library. This package is used in plotting the data, such as a Scatter plot or Line plot. We will use ‘plt’ as an alias for this.
Next, we will be importing 5 different packages from the Sklearn library. Sklearn is short for scikit learn. Feel free to read the previous document about each individual sklearn packages at any point of time during this video.
Now, we import the linear model package which contains the Linear Regression function.
Next we import the pre-processing package, and from this we import the standard scaler function. This will be used to adjust the input parameters to the same scale.
Next, we import the pre-processing package, and from this we import the Imputer function to replace all the NaN values.
Next, we import the Grid Search function from the model selection package.
And finally, let’s import the last function, that is the PipeLine. We will import it from the pipeline package. Then, we will read the OHLC data from the CSV. and save it in a data frame called ‘Df’.
The data frame contains entries that are not a number or ‘NaN’. We will drop such data using drop-na function.

Quantra is an online education portal that specializes in Algorithmic and Quantitative trading. Quantra offers various bite-sized, self-paced and interactive courses that are perfect for busy professionals, seeking implementable knowledge in this domain.

Find more info on - https://quantra.quantinsti.com/