- Company: Codtech IT Solutions Private Limited
- Name: Abhishek Sharma
- Intern ID: CTIS9913
- Domain: Data Science
- Duration: 6 Weeks
The END-TO-END STUDENT PERFORMANCE PREDICTION SYSTEM is an End-to-End Data Science project developed as part of the Data Science Internship Program at Codtech IT Solutions Private Limited. This project demonstrates the complete machine learning lifecycle, starting from data collection and preprocessing to model training, evaluation, and deployment using FastAPI.
The primary goal of this project is to predict a student's final exam performance based on several academic and personal factors. The model analyzes various features such as study hours, attendance rate, previous academic scores, sleep habits, tutoring sessions, parental education level, internet accessibility, and extracurricular participation to estimate the expected examination score.
In addition to machine learning model development, this project focuses on deploying the trained model as a REST API using FastAPI, allowing users to submit student information and receive predictions in real time. The project showcases how data science solutions can be transformed into practical applications that are accessible through modern web technologies.
Dataset Name: student_performance_sample.csv
Target Variable:
- exam_score
Input Features:
- age
- study_hours_per_week
- attendance_rate
- previous_score
- sleep_hours
- tutoring_sessions
- parental_education
- internet_access
- extracurricular
The dataset contains student academic and behavioral information used to predict final examination performance.
The main objectives of this project are:
- To understand and implement a complete Data Science workflow.
- To perform data preprocessing and feature engineering.
- To conduct Exploratory Data Analysis (EDA) for extracting insights.
- To train and evaluate multiple machine learning models.
- To select and save the best-performing model.
- To deploy the trained model using FastAPI.
- To provide real-time prediction services through API endpoints.
- To demonstrate practical machine learning deployment in a production-like environment.
- Python
- Pandas
- NumPy
- Matplotlib
- Scikit-learn
- Joblib
- FastAPI
- Uvicorn
The project follows a structured Data Science pipeline consisting of multiple stages.
A student performance dataset is used as the foundation of the project. The dataset contains information about student academic behavior and performance indicators. These attributes serve as input variables for training the machine learning model.
Before training the model, the dataset undergoes preprocessing and cleaning procedures, including:
- Handling missing values
- Removing duplicate records
- Data type validation
- Outlier detection and treatment
- Data consistency checks
These steps ensure the dataset is reliable and suitable for machine learning applications.
Exploratory Data Analysis is performed to understand patterns and relationships within the dataset. Various visualizations and statistical summaries are generated to identify important trends.
EDA includes:
- Dataset overview
- Feature distributions
- Correlation analysis
- Missing value analysis
- Statistical summaries
- Data visualization using charts and plots
Generated visualizations are stored in the outputs directory.
The following visualizations were generated during Exploratory Data Analysis:
- exam_score_distribution.png
- correlation_matrix.png
- null_values.png
- study_hours_vs_score.png
- dataset_overview.txt
These outputs helped identify feature relationships, missing values, and performance trends within the dataset.
Machine learning algorithms require properly formatted data. Therefore, preprocessing techniques are applied, including:
- Numerical feature scaling using StandardScaler
- Categorical feature encoding using One-Hot Encoding
- Feature transformation
- Train-test data splitting
These preprocessing steps improve model performance and ensure consistency during prediction.
Multiple machine learning algorithms are trained and evaluated.
Models used:
- Linear Regression
- Random Forest Regressor
The models are compared using evaluation metrics such as:
- Mean Absolute Error (MAE)
- Root Mean Squared Error (RMSE)
- R² Score
The best-performing model is automatically selected and saved for deployment.
After training, the selected model is serialized and saved using Joblib. The saved model is then integrated into a FastAPI application.
The API accepts student information as input and returns predicted exam scores in JSON format.
Method: GET
/Response:
{
"message": "Project Running Successfully"
}This endpoint confirms that the API is running correctly.
Method: POST
/predictSample Request:
{
"age": 18,
"study_hours_per_week": 25,
"attendance_rate": 90,
"previous_score": 82,
"sleep_hours": 7,
"tutoring_sessions": 2,
"parental_education": "Bachelor",
"internet_access": "Yes",
"extracurricular": "Yes"
}Sample Response:
{
"prediction": 97.37,
"message": "Prediction generated successfully."
}The prediction value represents the estimated final examination score based on the supplied input data.
Task3/
│
├── app/
│ └── main.py
│
├── data/
│
├── model/
│ └── model.joblib
│
├── outputs/
│
├── src/
│ ├── preprocessing.py
│ ├── train.py
│ └── predict.py
│
├── requirements.txt
├── README.md
└── .gitignore
pip install -r requirements.txtpython src/train.pyuvicorn app.main:app --reload
or
python -m uvicorn app.main:app --reloadhttp://127.0.0.1:8000/docs
Swagger UI allows users to test API endpoints directly from the browser.
The project successfully demonstrates the complete implementation of an End-to-End Data Science workflow. The trained machine learning model is capable of predicting student performance based on academic and personal factors.
Multiple regression models were evaluated.
Models Compared:
- Linear Regression
- Random Forest Regressor
The best-performing model was selected automatically based on evaluation metrics and saved as:
model/model.joblib
Key achievements include:
- Data preprocessing and cleaning
- Exploratory Data Analysis
- Machine learning model training
- Model evaluation and comparison
- Model serialization using Joblib
- FastAPI deployment
- Real-time prediction API
- Interactive Swagger documentation
The API successfully generates prediction results and provides a user-friendly interface for testing through FastAPI's built-in Swagger documentation system.
This project successfully fulfills the requirements of an End-to-End Data Science application by integrating data preprocessing, machine learning, and API deployment into a single workflow. The implementation demonstrates how predictive models can be transformed into real-world applications using FastAPI and Python.
The project serves as a practical example of machine learning deployment and highlights the importance of combining data analysis, model development, and software engineering practices to build scalable and accessible AI-powered solutions.