A linear regression model built from scratch in Python that predicts a student's Performance Index based on study habits and lifestyle factors β using only NumPy and csv, no ML libraries.
Student_Performance.csv β 10,000 student records with the following features:
| Feature | Description |
|---|---|
| Hours Studied | Daily study hours |
| Previous Scores | Scores from previous exams |
| Extracurricular Activities | Yes / No (encoded to 1 / 0) |
| Sleep Hours | Average sleep per night |
| Sample Question Papers Practiced | Number of practice papers |
| Performance Index | Target variable (0β100) |
Make sure you have Python 3 and NumPy installed.
pip install numpy
python3 main.py- Loads and preprocesses the CSV (Yes/No encoded to 1/0)
- Normalizes all features using mean and standard deviation
- Initializes weights and bias to zero
- Computes gradients manually using batch gradient descent
- Updates weights and bias each epoch
- Prints cost every 100 epochs to track training progress
main.py # Model implementation
Student_Performance.csv # Dataset
README.md # Project documentation
- Python 3
- NumPy
- Inspired by Andrew Ng's Machine Learning Specialization (Course 1)
Sanket Dalal
B.Tech IT β Delhi Technological University
GitHub | LinkedIn