Skip to content

Forecasting Tesla's monthly closing stock prices using historical data and machine/deep learning models. Includes ARIMA, SVM, Random Forest, LSTM, and BiLSTM for trend prediction and model comparison

Notifications You must be signed in to change notification settings

smagen12/Project_Tesla-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tesla Stock Price Forecasting (ML Pipeline)

A machine learning pipeline for forecasting Tesla's closing stock prices using:

  • Linear Regression
  • Support Vector Machine (SVM)
  • LSTM (optional extension)

This project includes: βœ… Data preprocessing
βœ… Sliding window supervised dataset creation
βœ… Model training & evaluation
βœ… Recursive future prediction
βœ… Pytest unit tests
βœ… GitHub Actions continuous integration


Evaluation Metrics:

Mean Absolute Error (MAE)
Root Mean Squared Error (RMSE)
Visual Actual vs Predicted plots
Model comparison bar charts
Hyperparameter tuning with GridSearchCV and KerasTuner

## πŸ“‚ Project structure

my-tesla-ml-project/ β”œβ”€β”€ .github/workflows/python-tests.yml # GitHub Actions CI workflow β”œβ”€β”€ tests/test_ml_pipeline.py # Pytest unit tests β”œβ”€β”€ requirements.txt # Project dependencies β”œβ”€β”€ src/project_tesla.py # code └── README.md # Project documentation


---

## βš™οΈ Setup

### Clone the repository
```bash
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name

Install dependencies

pip install -r requirements.txt

πŸš€ Run the pipeline

You can run your ML code from src/ (or main notebook/script).
Example:

python src/your_ml_code.py

πŸ§ͺ Run tests

To run tests locally:

pytest -v tests/

GitHub Actions will run tests automatically on push / PR.


πŸ“ˆ Example output

  • Plots: Actual vs predicted prices
  • Metrics: MAE, RMSE reported for test data
  • Future forecasts: Recursive predictions for future closing prices

πŸ”‘ Notes

  • Ensure you have access to the Tesla stock CSV dataset (e.g. TSLA.csv).
  • The pipeline assumes time series order (no shuffle in train/test split).

πŸ›  TODO

  • Add more features (Open, High, Low, Volume)
  • Add stacked models / ensembles
  • Add hyperparameter tuning for LSTM

About

Forecasting Tesla's monthly closing stock prices using historical data and machine/deep learning models. Includes ARIMA, SVM, Random Forest, LSTM, and BiLSTM for trend prediction and model comparison

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •