Skip to content

Taha234-coder/Internship_Projects

Repository files navigation

Project Overview

The goal of this project is to predict future stock prices based on historical stock data.
We used features like Open, High, Low, Close, and Volume to train a regression model and evaluate its prediction accuracy.


Dataset

  • File: stock.csv
  • Columns:
    • Date — Trading date
    • Open — Opening price
    • High — Highest price of the day
    • Low — Lowest price of the day
    • Close — Closing price
    • Volume — Trading volume

Tools & Libraries

  • Python
  • Pandas
  • NumPy
  • Matplotlib
  • scikit-learn (Linear Regression, train-test split, metrics)

Data Preprocessing

  • Converted Date column to datetime and sorted by date
  • Handled missing values using forward fill
  • Optional feature: Added Average price = (High + Low) / 2

Model Training

  • Model: Linear Regression
  • Features: Open, High, Low, Volume, Average
  • Target: Close
  • Train-Test Split: 80%-20% (time series, shuffle=False)

Model Evaluation

  • Metrics:
    • Mean Squared Error (MSE)
    • R² Score
  • Chart: Actual Close vs Predicted Close

Observations

  • Linear Regression can predict general trend of stock prices
  • Model performance can be improved with advanced models like LSTM or Random Forest Regression
  • Key features influencing prediction: Open, High, Low, Volume, Average

How to Run

  1. Place stock.csv in the project folder
  2. Run stock_prediction.py in VS Code or any Python IDE
  3. View terminal outputs and chart

Screenshots

  • Terminal outputs: dataset info, MSE, R²
  • Chart: Actual vs Predicted Close Price

About

Data Science Internship Projects — Titanic & Stock Prediction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages