**Stock Price Prediction — Machine Learning**

**Machine Learning Algorithms have made stock price prediction much easier and more reliable.**

In Today’s technology-driven world of Artificial Intelligence, Machine Learning, and Deep Learning predicting stock market trends and prices has become extremely popular. That’s due to the availability of numerous data and systematic analysis of this data through different algorithms. As we know stock markets have always been a very important mode of investment for businesses and today due to Artificial Intelligence and its different algorithms its has become much easier, less time-consuming, and more reliable. Hence many AI Startups are leveraging themselves with this technology. In this blog, we shall see the working of different algorithms used in studying, analyzing, and predicting stock market prices.

**Long Short Term Memory Network(LSTM)**

Long Short Term Memory Network has a chain-like structure which is initial used in computing the information and then predicting the outcome in the form of time-series data. Basically, LSTM is a type of Recurrent Neural Network also known as RNN. Here working of this network takes place in three steps. They are,

**First Step**: Here the information is differentiated. And then the unwanted data is deleted with the help of sigmoid function.**Second Step**: Here the work takes place with the help of two different functions. Sigmoid function is used to decide those values that have to proceed from 0 to 1. Then the tanh function decides the weightage of the values that have proceeded between 1 to -1 according to their significance.**Third Step**: Here the final output is finalized with the help of both functions.

**Evaluation metrics**

As prediction of stock market prices is the regression method.

**MAPE** (Mean Absolute Percentage Error %) is used to measure the percentage difference respective to the true value.

**RMSE**(Root Mean Squared Error) gives us the difference between predicted and true values.

Both methods are extremely useful in predicting the estimated output.

**Linear Regression**

Linear Regression is one of the elementary Machine Learning algorithms which does the execution of the data.

y= a0+a1x+ ε

**K-Nearest Neighbours**

This algorithm is extremely useful in finding any relation between old data and new data.

Hence we can say that Machine Learning Algorithms can be extremely useful in predicting stock prices and analyzing different data for long-term investments.