Skip to content

zaifnatra/ev-ml

Repository files navigation

EV Market Predictive Analytics

Our project focuses on predicting daily stock movements for leading electric-vehicle (EV) companies. This is a binary classification task, where the objective is to determine whether the next day's closing price of major EV stocks, namely Tesla (TSLA), NIO (NIO), Rivian (RIVN), General Motors (GM), and BYD (BYDDF), will increase (1) or decrease (0) compared to the current day.

Project Overview

This application serves as a dashboard blending technical analysis with machine learning insights. It aggregates real-time stock data and macroeconomic indicators to train a logistic regression model for directional price forecasting.

Key features include:

  • Interactive dashboard built with Streamlit.
  • Real-time data fetching using Yahoo Finance and FRED API.
  • Technical indicators calculation (RSI, MACD, Bollinger Bands).
  • Outlier detection using Robust Z-Score.
  • Binary classification model for next-day price direction.

data Sources

  • Stock Data: Yahoo Finance (TSLA, NIO, RIVN, GM, BYDDF)
  • Macroeconomic Data: Federal Reserve Economic Data (FRED)
    • Federal Funds Rate (FEDFUNDS)
    • Consumer Price Index (CPIAUCSL)
    • Unemployment Rate (UNRATE)

Installation

  1. Clone the repository.
  2. Install the required Python packages:
pip install streamlit plotly yfinance fredapi scikit-learn pandas numpy

Configuration

The application requires a FRED API Key to fetch macroeconomic data.

  1. Obtain an API Key from FRED.
  2. Create a secrets file at .streamlit/secrets.toml:
FRED_API_KEY = "your_api_key_here"

Alternatively, you can set FRED_API_KEY as an environment variable.

Usage

Run the application from the terminal:

python -m streamlit run app.py

The dashboard will open in your default web browser at http://localhost:8501.

Project Structure

  • app.py: Main application entry point handling UI and visualization.
  • utils.py: Backend utilities for data fetching, processing, and machine learning.
  • project.py: Original research script (legacy).

About

ev machine learning project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages