Using Machine Learning and Deep Learning algorithms like Linear Regression (LR), Neural Networks (NN), and Recurrent Neural Networks (RNN) to predict Google's stock prices.
- Linear Regression (LR)
- Neural Networks (NN)
- Recurrent Neural Networks (RNN) - Demonstrated in the provided code.
- Data Preprocessing: Uses
pandas
for data manipulation andMinMaxScaler
fromsklearn
for normalization. - RNN Model Architecture: Built using Keras with the following layers:
- LSTM layers with dropout for regularization.
- Dense output layer.
- Visualization: Displays real vs. predicted Google stock prices for 2017 using
matplotlib
.
- Training Data: 'Google_Stock_Price_Train.csv'
- Testing Data: 'Google_Stock_Price_Test.csv'
- Ensure you have the above-mentioned libraries installed.
- Load the training and testing datasets.
- Run the Python script. The script will preprocess the data, train the RNN model, and then visualize the real and predicted Google stock prices for 2017.
The visual output will showcase the actual Google stock price in red and the predicted price in blue. The title indicates the prediction for the year 2017.
Note: The accuracy metric used in the example is not suitable for regression tasks. A metric like Mean Squared Error (MSE) would be more appropriate.
- LSTM Networks
- Keras Documentation
- Google Stock Data (example source) (Replace with your actual source if different)
Fadi Helal
This project is open-source under the BSD 3-Clause License.