Facebook Stock Prediction Using Python & Machine Learning

randerson112358
ITNEXT
Published in
7 min readJul 1, 2019

--

Support Vector Regression

In this article I will show you how to create your own stock prediction Python program using a machine learning algorithm called Support Vector Regression (SVR). The program will read in Facebook (FB) stock data and make a prediction of the price based on the day.

It is extremely hard to try and predict the direction of the stock market or stock price, but in this article I will give it a try. Even people with a good understanding of statistics and probabilities have a hard time doing this.

Disclaimer: The material in this article is purely educational and should not be taken as professional investment advice. Invest at your own discretion.

A Support Vector Regression (SVR) is a type of Support Vector Machine,and is a type of supervised learning algorithm that analyzes data for regression analysis. In 1996, this version of SVM for regression was proposed by Christopher J. C. Burges, Vladimir N. Vapnik, Harris Drucker, Alexander J. Smola and Linda Kaufman. The model produced by SVR depends only on a subset of the training data, because the cost function for building the model ignores any training data close to the model prediction.

Support Vector Machine Pros:

  1. It is effective in high dimensional spaces.
  2. It works well with clear margin of separation.
  3. It is effective in cases where number of dimensions is greater than the number of samples.

Support Vector Machine Regression Cons:

  1. It does not perform well, when we have large data set.
  2. Low performance if the data set is noisy ( a large amount of additional meaningless information).

Types Of Kernel:

  1. linear
  2. polynomial
  3. radial basis function (rbf)
  4. sigmoid

If you prefer not to read this article and would like a video representation of it, you can check out the YouTube Video below. It goes through everything in this article with a little more detail, and will help make it easy for you to start programming…

--

--