This project involves predicting the stock prices of Apple Inc. using historical data and various regression techniques. The models were implemented and evaluated using Python, with a focus on Linear Regression, Ridge Regression, and Lasso Regression.
- Python
- NumPy
- Pandas
- Matplotlib
- scikit-learn
- Historical stock price data for Apple Inc. was obtained from Yahoo Finance in CSV format.
- Processed and visualized stock price data.
- Calculated moving averages to smoothen stock price trends.
- Analyzed return deviation to understand price fluctuations.
- Implemented three regression models:
- Linear Regression
- Ridge Regression
- Lasso Regression
- Split the data into training (80%) and testing (20%) sets.
- Evaluated model performance using the testing data.
- Compared the accuracy of the three regression models.
- Identified the best-performing model based on the accuracy score.
- Visualized the actual vs. predicted stock prices.
- Plotted moving averages alongside adjusted closing prices.
- Displayed future stock price predictions for a 30-day period.
- The model that performed best was the Lasso Regression, achieving an accuracy score of 96.3%.
This project demonstrates the application of regression models for stock price prediction and highlights the importance of data visualization and model evaluation in financial forecasting.
Note: The historical stock price data used in this project was sourced from Yahoo Finance and is intended for educational and illustrative purposes only.