Skip to content

tianalongjam/Stock-Price-Predictions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Tesla Stock Price Prediction – Python, Scikit-learn, XGBoost, Pandas, NumPy, Matplotlib

📘 Overview

This project predicts Tesla’s daily stock price movement (up or down) using historical OHLC data and machine learning models.
It demonstrates skills in data preprocessing, feature engineering, classification, model evaluation, and financial data analysis.


🧠 Key Concepts & Modules

Core Concepts:

  • Feature Engineering (derived price metrics, volatility indicators)
  • Classification Modeling (Logistic Regression, SVM, XGBoost)
  • Model Evaluation (Accuracy, Cross-Validation, Confusion Matrix)
  • Predictive Analytics for Financial Time Series

Modules/Libraries:
pandas, numpy, matplotlib, seaborn, scikit-learn, xgboost


📂 Project Structure

Tesla-Stock-Prediction/
│
├── data/
│   └── tesla.csv                # Historical Tesla stock data
│
├── tesla_stock_prediction.py    # Main ML pipeline code
│
├── README.md                    # Project documentation
│
└── results/
    └── plots/                   # Saved performance and trend plots

--

⚙️ Workflow

1️⃣ Data Preprocessing

  • Loaded and cleaned Tesla stock data
  • Created new features:
    • open-close → measures daily price difference
    • low-high → measures volatility
    • is_quarter_end → identifies end-of-quarter trading days
  • Split data into training and validation sets using train_test_split

2️⃣ Model Training

Implemented and trained multiple classification models:

  • Logistic Regression
  • Support Vector Classifier (SVC)
  • XGBoost Classifier

3️⃣ Model Evaluation

Evaluated performance using:

  • Accuracy Score
  • Confusion Matrix
  • Cross-Validation (cross_val_score)

Visualized model comparison using Matplotlib and Seaborn.


📊 Results

Model Accuracy Key Insight
Logistic Regression ~55–60% Baseline model for comparison
Support Vector Classifier ~60–65% Captures non-linear boundaries
XGBoost Classifier ~70%+ Best performance through boosting

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors