Skip to content

This project analyzes Tesla stock data and builds machine learning models to predict and classify stock movements. The analysis includes EDA, feature correlation, moving averages, and two models

License

Notifications You must be signed in to change notification settings

Affan005-ai/Tesla-Stock-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📈 Tesla Stock Prediction

📌 Project Overview

This project analyzes Tesla stock data and builds machine learning models to predict and classify stock movements.
The analysis includes EDA, feature correlation, moving averages, and two models:

  • Linear Regression → Predict Closing Price (regression task)
  • Logistic Regression → Predict whether next day's price goes up (classification task)

📊 Exploratory Data Analysis

  • 1 Trend analysis of Tesla stock Closing prices over time

Line Plot Graph

  • 2 Trend analysis of Tesla stock Closing prices over the years

Bar Plot Graph

  • 3 50-day vs 200-day moving averages

Line Plot Graph

  • 4 Correlation heatmap of stock features

Line Plot Graph

  • 5 Volume vs Closing Price scatter plot

Line Plot Graph


🤖 Models Used

🔹 Linear Regression

  • Predicts the Closing Price of Tesla stock.
  • Evaluation metric: R² score, RMSE, MAE.
  • Visualization: Actual vs Predicted Closing Prices.

🔹 Logistic Regression

  • Predicts whether the price will go up or down next day (Price_Up = 1 or 0).
  • Evaluation metrics: Accuracy, Precision, Recall, F1-score.
  • Visualization: Confusion Matrix heatmap.

📊 Model Comparison

1️⃣ Linear Regression – Actual vs Predicted Closing Price

Linear Regression Graph

2️⃣ Logistic Regression – Confusion Matrix

Logistic Regression Confusion Matrix

3️⃣ Side-by-Side Metric Comparison

Model Performance Comparison

  • Linear Regression (R²) → measures how well regression predictions fit actual prices
  • Logistic Regression (Accuracy) → measures classification correctness

🛠️ Tech Stack

  • Python, Pandas, NumPy
  • Matplotlib, Seaborn
  • Scikit-learn

🚀 How to Run

git clone https://github.com/YOUR-USERNAME/Tesla-Stock-Prediction.git
cd Tesla-Stock-Prediction
pip install -r requirements.txt
jupyter notebook Tesla_Stock_Prediction.ipynb

About

This project analyzes Tesla stock data and builds machine learning models to predict and classify stock movements. The analysis includes EDA, feature correlation, moving averages, and two models

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published