0% found this document useful (0 votes)
2 views62 pages

Student Performance Prediction Using ML

Student performance prediction using machine learning
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views62 pages

Student Performance Prediction Using ML

Student performance prediction using machine learning
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CHAPTER 1

INTRODUCTION
1.1 Background

Education plays an essential role in the development of individuals and society. With the
growth of digital technologies, large amounts of educational data are being collected by
institutions. Analyzing this data can help uncover hidden patterns and relationships that
influence student learning outcomes.

Machine Learning is a powerful tool that allows computers to learn from data and make
predictions without explicit programming. In the field of education, machine learning
techniques can be used to analyze student performance and identify factors that affect
academic success.

Predicting student performance can help teachers and educational institutions identify
students who may need additional support. It can also help institutions improve their teaching
strategies and learning environments.

This project focuses on analyzing a student performance dataset and building a machine
learning model to predict student academic outcomes. The analysis involves data
preprocessing, exploratory data analysis, visualization, and model building.

By studying different factors such as gender, parental education level, lunch type, and
preparation courses, we can understand how these variables affect student performance.

1.2 Objectives of the project

The main objectives of this project are as follows:

1. To analyze a student performance dataset using data analysis techniques.

2. To identify the key factors affecting student academic performance.

3. To perform exploratory data analysis using statistical and visualization methods.

4. To build a machine learning model capable of predicting student scores.

5. To understand the relationship between demographic factors and student results.

6. To present the findings using graphs and visualizations.

7. To develop a predictive system that can assist educators in evaluating student


performance.

2
1.3 Purpose, Scope, Applicability

1.3.1 Purpose

The purpose of this project is to study the academic performance of students using machine
learning techniques. By analyzing the dataset, we aim to understand how various factors such
as gender, parental education, lunch type, and preparation courses influence student scores.

The project also aims to build a predictive model that can estimate student performance based
on input attributes. Such systems can be useful in identifying students who may require
additional academic support.

1.3.2 Scope

The scope of this project is limited to analyzing student performance data using machine
learning techniques. The dataset contains information related to student demographics and
exam scores.

The analysis includes data preprocessing, visualization, and model development. The project
does not include real-time educational data but focuses on a static dataset used for training
and evaluation purposes.

Future systems may integrate real-time educational data and advanced machine learning
models for improved prediction accuracy.

1.3.3 Applicability

This project has several practical applications in the field of education.

Educational institutions can use predictive systems to identify students who are at risk of poor
academic performance. Teachers can use these insights to provide additional support to
students who require help.

Educational researchers can use such analysis to study the impact of socioeconomic and
demographic factors on academic outcomes.

This project demonstrates how machine learning can be used to support data-driven decision-
making in education.

3
CHAPTER 2

DATASET DESCRIPTION

4
2.1 Overview of Dataset Choice
The dataset used in this project is the Student Performance Dataset, which contains
information about students' academic performance and demographic characteristics. The
dataset includes factors such as gender, race or ethnicity, parental level of education, lunch
type, and test preparation course.

The dataset contains 1000 student records and 8 attributes. These attributes provide
information about the background of students as well as their exam scores in mathematics,
reading, and writing.

This dataset is widely used in educational data mining and machine learning research to
analyze academic performance and identify patterns affecting student outcomes.

5
2.2 Justification for Dataset Selection

The Student Performance dataset was selected because it contains multiple attributes that
influence academic results. These attributes include demographic information and exam
scores, which makes the dataset suitable for performing exploratory data analysis and
predictive modeling.

The dataset provides a balanced representation of students with different backgrounds,


allowing researchers to study the relationship between socioeconomic factors and academic
performance.

Additionally, the dataset is structured and contains both categorical and numerical features,
which makes it ideal for demonstrating machine learning techniques.

2.3 Dataset Attributes

Attribute Description

Gender Male or Female

Race/Ethnicity Group A, B, C, D, E

Parental Education Parent’s education level

Lunch Standard or Free/Reduced

Test Preparation Completed or None

Math Score Marks in mathematics

Reading Score Marks in reading

Writing Score Marks in writing

CHAPTER 3

6
METHODS AND ALGORITHMS

7
3.1 Overview of Machine Learning

Machine Learning is a subfield of Artificial Intelligence that focuses on developing


algorithms and statistical models that allow computers to learn patterns from data and make
predictions or decisions without being explicitly programmed. Instead of relying on
predefined rules, machine learning systems improve their performance automatically by
learning from past data.

Machine learning has become an important technology in many industries such as healthcare,
finance, education, and business analytics. It helps organizations analyze large volumes of
data and extract meaningful insights that can assist in decision-making processes.

In traditional programming, developers write explicit instructions that the computer follows
to produce an output. However, in machine learning, the system learns the relationship
between input variables and output variables from historical data. Once the model is trained,
it can use this learned knowledge to predict outcomes for new unseen data.

Machine learning techniques are generally categorized into three major types:

Supervised Learning

Supervised learning is a machine learning approach where the model is trained using labeled
data. In this method, both the input variables and the correct output values are provided to the
algorithm during training. The model learns the relationship between inputs and outputs and
uses this knowledge to predict results for new data. Examples of supervised learning
algorithms include Linear Regression, Decision Trees, Random Forest, and Support Vector
Machines.

Unsupervised Learning

Unsupervised learning involves training models using unlabeled data. In this case, the
algorithm attempts to identify hidden patterns or structures within the dataset without
predefined output labels. Clustering and dimensionality reduction techniques such as K-
Means clustering and Principal Component Analysis are examples of unsupervised learning
methods.

8
Reinforcement Learning

Reinforcement learning is a type of machine learning where an agent learns by interacting


with an environment. The system receives rewards or penalties based on its actions and
gradually learns the best strategy to maximize the reward.

In this project, supervised machine learning techniques are used to analyze student
performance data. The dataset contains historical information about students such as gender,
race or ethnicity, parental level of education, lunch type, and test preparation course along
with their exam scores in mathematics, reading, and writing.

The machine learning model is trained using this dataset to learn patterns and relationships
between these features and student performance. Once the model is trained, it can predict the
expected performance of students based on input attributes.

For example, if we provide information about a student’s background such as parental


education level, lunch type, and preparation course, the trained model can estimate the
student’s expected academic performance.

Machine learning models rely heavily on the quality of the data used during training.
Therefore, proper data preprocessing and exploratory data analysis are essential steps before
building predictive models. These steps help clean the dataset, remove inconsistencies, and
understand the relationships between variables.

The application of machine learning in education is often referred to as Educational Data


Mining. It helps educators analyze academic data to improve learning outcomes and identify
students who may require additional academic support.

By applying machine learning techniques to student performance data, this project aims to
provide insights into the factors that influence academic results and demonstrate how
predictive models can be used in educational environments.

9
In this project, supervised learning regression algorithms were used to predict student
mathematics scores based on demographic and academic features.

The dataset contains information about:

• Gender

• Race/Ethnicity

• Parental Level of Education

• Lunch Type

• Test Preparation Course

• Reading Score

• Writing Score

The machine learning model analyzes these features to predict the Math Score of a student.

Machine learning can help educational institutions identify patterns in student performance
and take early measures to improve academic outcomes.

3.2 Regression Algorithms

Regression algorithms are used when the target variable is numerical. In this project, the
objective is to predict the math score of students, which is a continuous numerical value.

Several regression algorithms were implemented and compared to determine which model
performs best.

The regression algorithms used in this project include:

• Linear Regression

• Ridge Regression

• Lasso Regression

• K-Nearest Neighbors Regressor

10
• Decision Tree Regressor

• Random Forest Regressor

• CatBoost Regressor

• AdaBoost Regressor

Each algorithm has its own approach to learning patterns from data.

3.3 Linear Regression

Linear Regression is one of the simplest and most widely used machine learning algorithms
for regression problems. It attempts to establish a linear relationship between independent
variables and the dependent variable.

The mathematical representation of linear regression is:

y=b0+b1x1+b2x2+...+bnxn

Where:

y = predicted value

b0 = intercept

b1,b2 = coefficients

x1,x2 = input variables

Linear regression assumes that the relationship between features and target variables is linear.

In this project, linear regression was used to predict math scores based on student attributes.

11
3.4 Ridge Regression

Ridge Regression is an extension of linear regression that adds a regularization term to


prevent overfitting.

The Ridge regression equation includes a penalty term:

Loss=RSS+λ∑i=1nwi2Loss = RSS + \lambda \sum_{i=1}^{n} w_i^2Loss=RSS+λi=1∑nwi2

This helps reduce model complexity and improves generalization.

Ridge regression performed well in this project and achieved one of the highest R² scores.

12
3.5 Lasso Regression

Lasso Regression is another regularization technique that adds a penalty based on the
absolute values of coefficients.

Unlike Ridge regression, Lasso can reduce some feature coefficients to zero, effectively
performing feature selection.

This helps identify the most important variables influencing student performance.

3.6 Decision Tree Regression

Decision Tree Regression is a non-linear machine learning algorithm that splits the dataset
into smaller subsets based on feature conditions.

Each node represents a decision rule and each leaf node represents a prediction value.

Decision trees are easy to interpret but may suffer from overfitting if not properly controlled.

In this project, the decision tree achieved very high training accuracy but lower testing
accuracy, indicating possible overfitting.

13
3.7 Random Forest Regression

Random Forest is an ensemble learning technique that combines multiple decision trees to
improve prediction accuracy.

Instead of relying on a single decision tree, random forest builds multiple trees and averages
their predictions.

Advantages:

• Reduces overfitting
• Improves accuracy
• Handles complex relationships

Random Forest achieved good performance in this project.

3.8 K-Nearest Neighbors Regression

K-Nearest Neighbors (KNN) is a non-parametric algorithm that predicts the output based on
the average values of the nearest neighbors.

The algorithm calculates the distance between data points and selects the closest neighbors to
make predictions.

Although KNN is simple to implement, it may become computationally expensive for large
datasets.

14
3.9 CatBoost Regressor

CatBoost is a gradient boosting algorithm developed by Yandex. It is particularly effective


for datasets containing categorical features.

Advantages of CatBoost include:

• High accuracy
• Automatic handling of categorical features
• Reduced overfitting

In this project, CatBoost provided competitive results compared to other algorithms.

3.10 AdaBoost Regression

AdaBoost is another ensemble technique that combines multiple weak learners to form a
strong predictive model.

It works by assigning higher weights to incorrectly predicted samples so that subsequent


models focus more on difficult cases.

AdaBoost showed good predictive performance in this project.

15
CHAPTER 4

PROJECT ANALYSIS

16
4.1 Data Preprocessing

Data preprocessing is an important step in machine learning because raw data often contains
inconsistencies, missing values, or incorrect formats. Before building the machine learning
models, the dataset must be cleaned and prepared properly.

In this project, the dataset was imported using the Pandas library. Several preprocessing
operations were performed to understand and prepare the dataset for analysis.

The dataset contains 1000 student records and 8 attributes describing student demographic
and academic information.

The preprocessing steps include:

• Importing required libraries

• Loading dataset using Pandas

• Checking dataset shape

• Identifying missing values

• Checking duplicate entries

• Verifying data types

• Exploring unique values in categorical variables

• Generating statistical summary of numerical variables

Importing Required Libraries

The following libraries were used for the project:

• Pandas – Data manipulation

• NumPy – Numerical operations

• Matplotlib – Data visualization

17
• Seaborn – Advanced visualizations

• Scikit-Learn – Machine learning algorithms

import pandas as pd
import numpy as np
import [Link] as plt
import seaborn as sns

Loading the Dataset

The dataset was loaded using the Pandas read_csv() function.

df = pd.read_csv("data/[Link]")

[Link]()

Dataset Shape

The dataset contains:

• 1000 rows (student records)


• 8 columns (features)

[Link]

18
Checking Missing Values

Missing values can negatively affect machine learning models. Therefore, the dataset was
checked for missing values.

[Link]().sum()

Checking Duplicate Values


Duplicate records can distort analysis results. The dataset was checked for duplicate entries.

[Link]().sum()
Result: No duplicate records found

Data Type Verification


The dataset contains both categorical and numerical variables.

[Link]()
Numerical variables:

• math_score
• reading_score
• writing_score

19
Categorical variables:

• gender
• race_ethnicity
• parental_level_of_education
• lunch
• test_preparation_course

Statistical Summary
Statistical summary helps understand distribution of numerical variables.

[Link]()
Important observations:

• Average math score ≈ 66


• Average reading score ≈ 69
• Average writing score ≈ 68

20
21
4.2 Feature Engineering

Two additional columns were created:


Total Score
Average Score

Total Score = math_score + reading_score + writing_score


Average Score = total_score / 3

These features help summarize student academic performance.


df["total score"] = df["math_score"] + df["reading_score"] + df["writing_score"]
df["average"] = df["total score"]/3
[Link]()

4.3 Exploratory Data Analysis


Exploratory Data Analysis was conducted to understand patterns and relationships in the
dataset.
Various visualization techniques were used:
• Histogram
• Kernel Density Plot
• Bar Plot
• Pie Chart
• Box Plot
• Pair Plot

EDA helps reveal insights about student performance.

22
4.3.1 Histogram Analysis
Histograms were used to analyze the distribution of average student scores.
The histogram shows that most students score between 60 and 80 marks.

Histogram of average score.

4.3.2 Gender Analysis


Gender distribution analysis shows that male and female students are almost equally
represented in the dataset.
However, female students tend to achieve slightly higher overall average scores compared to
male students.

Gender pie chart

23
4.3.3 Race/Ethnicity Analysis
Students were categorized into five ethnic groups: A, B, C, D, and E.
Analysis shows that students belonging to Group E have the highest average scores, while
students from Group A tend to have the lowest scores.

Race ethnicity bar chart

4.3.4 Lunch Type Analysis


Students who receive standard lunch generally perform better compared to students
receiving free or reduced lunch.
This suggests that socioeconomic conditions may influence student performance.

24
Lunch distribution chart

25
4.3.5 Test Preparation Course Analysis

Students who completed the test preparation course tend to achieve higher scores compared
to those who did not.

This indicates that preparation courses positively impact academic performance.

Test preparation bar chart

26
4.4 Model Training
Several regression models were trained to predict math scores.

The models used include:


• Linear Regression
• Lasso Regression
• Ridge Regression
• K-Nearest Neighbors
• Decision Tree
• Random Forest
• CatBoost Regressor
• AdaBoost Regressor

Before training the models, categorical variables were converted using OneHotEncoder, and
numerical variables were standardized using StandardScaler.

ColumnTransformer(
("OneHotEncoder", oh_transformer, cat_features),
("StandardScaler", numeric_transformer, num_features)
)

4.5 Model Evaluation

The dataset was divided into training and testing sets.

Training data = 80%


Testing data = 20%

train_test_split(X, y, test_size=0.2)

The models were evaluated using:

• Mean Absolute Error (MAE)


• Root Mean Squared Error (RMSE)
• R² Score

27
Among all models, Ridge Regression and Linear Regression achieved the best
performance with an R² score of approximately 0.88.

Model comparison table

4.5 Deployment

Deployment is the final stage of a machine learning project where the trained model is made
available for practical use. After building and evaluating the machine learning models, the
best performing model can be integrated into an application or system that allows users to
input data and receive predictions.
In this project, the machine learning model was trained using historical student performance
data. The model learned patterns between input attributes such as gender, race or ethnicity,
parental level of education, lunch type, test preparation course, reading score, and writing
score to predict the math score of students.

The trained model can be deployed in different ways such as:

• Web applications
• Educational dashboards
• School management systems
• Student performance monitoring systems

Once deployed, the system can help teachers and institutions analyze student performance
and identify students who may require additional academic support.

28
Model Integration
The trained regression model can be integrated with a web interface where users provide
student details as input.

Example inputs may include:


• Gender
• Race/Ethnicity
• Parental level of education
• Lunch type
• Test preparation course
• Reading score
• Writing score

Based on these inputs, the machine learning model processes the data and predicts the
expected mathematics score of the student.

The prediction process follows these steps:

1. Input data is collected from the user.


2. The input features are preprocessed using the same transformations applied during
training (such as OneHotEncoding and StandardScaler).
3. The processed data is passed to the trained regression model.
4. The model generates a predicted math score.
5. The predicted result is displayed to the user.

Practical Applications
The deployed system can be useful in several educational scenarios.

Academic Performance Monitoring


Educational institutions can monitor student performance trends and identify factors that
influence academic success.

Early Intervention for Students


Teachers can identify students who are likely to perform poorly and provide additional
support or guidance.

29
Data-Driven Educational Decisions
Administrators can analyze patterns in student data to improve teaching strategies and
academic programs.

Personalized Learning
Machine learning models can help create personalized learning paths based on student
performance.

Deployment Platforms
The machine learning model can be deployed using different platforms and technologies.

Some common deployment options include:

Flask / Django

Python web frameworks that allow integration of machine learning models with web
applications.

Streamlit

A simple framework for creating interactive machine learning dashboards.

Cloud Platforms

Models can also be deployed on cloud services such as:

• AWS
• Google Cloud Platform
• Microsoft Azure

These platforms allow scalable deployment and easy access to the model through APIs.

30
Deployment Workflow
The deployment process typically includes the following steps:

1. Train and evaluate machine learning models.

2. Select the best performing model.

3. Save the trained model using serialization tools such as Pickle or Joblib.

4. Build an interface to accept input data from users.

5. Load the saved model and preprocess input data.

6. Generate predictions using the trained model.

7. Display the predicted output to the user.

Example code for saving the trained model:

import pickle

[Link](lin_model, open("student_performance_model.pkl", "wb"))


Example code for loading the model:

model = [Link](open("student_performance_model.pkl", "rb"))

Model Deployment Benefits


Deploying the machine learning model provides several advantages:

• Enables real-time prediction of student performance


• Helps teachers identify struggling students early
• Supports data-driven decision making in education
• Improves academic planning and learning outcomes

31
CHAPTER 5

IMPLEMENTATION AND TESTING

32
33
5.1 Code Implementation

The implementation of the Student Performance Prediction system was carried out using the
Python programming language and various data science libraries. Python provides powerful
tools for data analysis, machine learning, and visualization, making it suitable for educational
data analysis projects.
The entire implementation was performed using Jupyter Notebook, which allows interactive
development, execution of code cells, and visualization of results.
Several libraries were used during the implementation process.

Pandas
Pandas is used for handling structured data and performing operations such as loading
datasets, filtering records, and performing statistical analysis. In this project, the student
dataset was loaded into a Pandas DataFrame using the read_csv() function.

Example:
df = pd.read_csv("data/[Link]")
This dataset contains records of 1000 students with attributes such as gender, race/ethnicity,
parental level of education, lunch type, test preparation course, and subject scores.
[Link]()

NumPy
NumPy is used for numerical computations and mathematical operations. It supports high-
performance array operations and is widely used in machine learning applications.

In this project, NumPy was used for operations such as calculating square roots and
performing numerical calculations for evaluation metrics.

Matplotlib

Matplotlib is used for generating visualizations such as scatter plots and graphs. It was used
to visualize relationships between predicted and actual values.

Example visualization:

34
[Link](y_test, y_pred)

Actual vs Predicted values visualization

Seaborn

Seaborn is used for statistical visualization. It provides advanced plotting capabilities such as
histograms, boxplots, and pairplots.

In this project, Seaborn was used for:

• Histogram plots
• Kernel Density Estimation plots
• Violin plots
• Pairplots
• Count plots

These visualizations help in understanding relationships between different features in the


dataset.

35
Scikit-Learn

Scikit-Learn is one of the most widely used machine learning libraries in Python. It provides
tools for data preprocessing, model training, and model evaluation.

In this project, Scikit-Learn was used for:

• Feature preprocessing
• Data splitting
• Model training
• Model evaluation

Several regression algorithms were used to predict student performance.

5.2 Testing Approach

To evaluate the performance of the machine learning models, the dataset was divided into
training and testing sets.

The train_test_split() function from Scikit-Learn was used to perform the split.

Example:

X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2,random_state=42)

The dataset was split as follows:

Training data: 80% (800 records)


Testing data: 20% (200 records)

36
The training dataset was used to train the machine learning models, while the testing dataset
was used to evaluate the model performance.

X_train.shape
X_test.shape

37
CHAPTER 6

FINAL RESULT AND DISCUSSION


6.1 Impact of Hyperparameters

Hyperparameters control the learning behavior of machine learning models.

Different algorithms use different hyperparameters that influence the performance of the
model.

Examples include:

Random Forest:

• Number of trees
• Maximum tree depth
• Minimum samples per split

K-Nearest Neighbors:

• Number of neighbors (K value)

Ridge and Lasso Regression:

• Regularization parameter

In this project, default hyperparameters were used to evaluate the performance of different
regression algorithms.

The performance comparison helped identify the most accurate model for predicting student
performance.

6.2 Experimentation Outcome

Several regression models were trained and evaluated using the dataset.

The performance of the models was measured using evaluation metrics such as:

• Mean Absolute Error (MAE)


• Root Mean Squared Error (RMSE)
• R² Score

The results of the models are summarized below.


Model R² Score

Ridge Regression 0.8806

Linear Regression 0.8804

AdaBoost Regressor 0.8543

CatBoost Regressor 0.8516

Random Forest Regressor 0.8515

Lasso Regression 0.8253

K-Nearest Neighbors 0.7837

Decision Tree 0.7426

From the results, Ridge Regression achieved the highest R² score, indicating the best
prediction performance among the tested models.

6.3 Challenges Faced

Several challenges were encountered during the development of the project.

Data preprocessing challenges

Categorical variables such as gender, race, and lunch type needed to be converted into
numerical form using OneHotEncoding.

Feature engineering

New features such as total score and average score were created to better analyze student
performance.
Model comparison

Multiple machine learning models had to be trained and evaluated to determine the best
performing model.

Visualization interpretation

Analyzing visualizations required understanding relationships between multiple variables.

6.4 Key Takeaways

From the analysis of the dataset, several insights were obtained.

• Female students tend to perform better overall compared to male students.


• Male students perform slightly better in mathematics.
• Students who receive standard lunch perform better academically.
• Students who complete the test preparation course tend to achieve higher scores.
• Reading and writing scores strongly influence math performance.

These insights can help educational institutions identify patterns in student performance and
design strategies to improve learning outcomes.
CHAPTER 7

CONCLUSION AND FUTURE SCOPE


7.1 Conclusion
This project focused on analyzing and predicting student academic performance using
machine learning techniques.

The dataset consisting of 1000 student records was analyzed using exploratory data analysis
techniques and visualization methods.

Several regression algorithms were implemented to predict the mathematics score of students
based on demographic and academic features.

Among the tested models, Ridge Regression and Linear Regression achieved the highest
prediction accuracy of approximately 88%.

The results demonstrate that machine learning can effectively analyze educational datasets
and provide insights that may help improve academic performance.

7.2 Limitations

Although the project provides useful insights, it has certain limitations.

• The dataset contains only 1000 student records.


• The dataset includes limited features related to student background.
• External factors such as study hours, attendance, and teaching methods were not included.

These limitations may affect the accuracy of predictions.

7.3 Future Scope

Several improvements can be made in future work.

• Using larger datasets from multiple institutions


• Applying deep learning models for improved prediction accuracy
• Developing a web-based application for real-time prediction
• Integrating the system into school management platforms
• Building recommendation systems for student improvement
CHAPTER 8

REFERENCES
1. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Grisel, O., Blondel, M.,
Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D.,
Brucher, M., Perrot, M., & Duchesnay, E. (2011).
Scikit-learn: Machine Learning in Python.
Journal of Machine Learning Research, 12, 2825–2830.
Link: [Link]

2. McKinney, W. (2010).
Data Structures for Statistical Computing in Python.
Proceedings of the 9th Python in Science Conference.
Link: [Link]
3. Hunter, J. D. (2007).
Matplotlib: A 2D Graphics Environment.
Computing in Science & Engineering, 9(3), 90–95.
Link: [Link]

4. Waskom, M. (2021).
Seaborn: Statistical Data Visualization.
Journal of Open Source Software.
Link: [Link]

5. Géron, A. (2019).
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow.
O’Reilly Media.
Link:
[Link]

6. Bishop, C. M. (2006).
Pattern Recognition and Machine Learning.
Springer.
Link: [Link]

45
7. James, G., Witten, D., Hastie, T., & Tibshirani, R. (2013).
An Introduction to Statistical Learning.
Springer.
Link: [Link]

8. Kaggle Dataset Repository.


Students Performance in Exams Dataset.
Link: [Link]
datasetId=74977

9. Scikit-Learn Official Documentation.


Link: [Link]

10. Pandas Official Documentation.


Link: [Link]

11. Matplotlib Official Documentation.


Link: [Link]

12. Seaborn Official Documentation.


Link: [Link]

46
APPENDIX A
COMPLETE INSTALLATION GUIDE
A.1 Prerequisites:

Before running the Student Academic Performance Prediction system, several software tools
must be installed. These tools provide the required environment for running Python
programs, machine learning models, and the Flask web application.

The following prerequisites are required:

Python Programming Language


Python is the main programming language used for implementing the machine learning
model and the Flask web application.

Recommended version: Python 3.8 or higher

Download from:
[Link]

Jupyter Notebook

Jupyter Notebook was used during development for data preprocessing, visualization, and
model training.

Flask Web Framework

Flask is a lightweight Python web framework used to build the prediction interface. It allows
users to input student information through a web form and obtain predicted mathematics
scores.

Required Python Libraries

The following Python libraries are required:

• Pandas
• NumPy
• Matplotlib

48
Seaborn
• Scikit-Learn

• CatBoost
• Flask

Dataset

The dataset used in this project is the Student Performance Dataset containing 1000 student
records.

Example folder structure:

Student-Performance-Prediction-System/

├── .ebextensions/ # AWS Elastic Beanstalk configurations

├── artifacts/ # Data and Model outputs

│ ├── [Link] # Raw dataset

│ ├── [Link] # Trained model object

│ ├── [Link] # Data transformation object

│ ├── [Link] # Testing split

│ └── [Link] # Training split

├── catboost_info/ # CatBoost training metadata

│ ├── learn/

│ ├── tmp/

│ ├── catboost_training.json

│ ├── learn_error.tsv

│ └── time_left.tsv

├── logs/ # Application execution logs

├── notebooks/ # Experimental phase

│ ├── catboost_info/

49
│ ├── data/

│ ├── 1. EDA STUDENT [Link]

│ └── 2. MODEL [Link]

├── src/ # Core Source Code

│ ├── __pycache__/ # Compiled Python files

│ ├── components/ # Ingestion, Transformation, Trainer

│ ├── pipeline/ # Prediction and Training pipelines

│ ├── __init__.py

│ ├── [Link] # Custom exception handling

│ ├── [Link] # Custom logging configuration

│ └── [Link] # Helper functions (save/load objects)

├── static/

│ └── css/

│ └── [Link] # Frontend styling

├── templates/ # Web interface

│ ├── [Link] # Main dashboard/form

│ └── [Link] # Landing page

├── .gitignore # Git exclusion rules

├── .python-version # Python version marker

├── [Link] # Flask/Web Application entry

├── LICENSE # Project License

├── [Link] # Execution trigger

├── [Link] # Build configuration

├── [Link] # Project documentation

├── [Link] # Python dependencies

50
├── [Link] # Package installer

├── test_predictions.py # Verification script

├── train_model.py # Model training script

├── [Link] # UV dependency lockfile

└── venv/ # Virtual environment

A.2 Installation Commands

After installing Python, the required libraries can be installed using the pip package
manager.

The following commands should be executed in the command prompt or terminal.

commands:

Install Pandas

pip install pandas

Install NumPy

pip install numpy

Install Matplotlib

pip install matplotlib

Install Seaborn

pip install seaborn

Install Scikit-Learn

pip install scikit-learn

Install CatBoost

pip install catboost

Install Jupyter Notebook

pip install notebook

Start Flask application:


51
python [Link]

A.3 Common Errors and Solutions

While installing libraries or running the project, some errors may occur. These errors usually
happen due to missing packages or incorrect file paths.

The following are common errors and their solutions.

Error 1

Module not found error

Example:

ModuleNotFoundError: No module named 'sklearn'

Solution:

Install the missing package.

pip install scikit-learn

Error 2

Dataset not found error

Example:

FileNotFoundError: [Link] not found

Solution:

Ensure the dataset is placed in the correct folder.

Correct folder structure:

Project Folder

├── [Link]
└── data
└── [Link]

52
APPENDIX B
USER MANUAL

53
B.1 System Overview

The Student Academic Performance Prediction system uses machine learning algorithms to
estimate the mathematics score of students based on demographic and academic attributes.

The system consists of two major components:

Machine Learning Model

The predictive model was trained using the Student Performance Dataset and several
regression algorithms such as Linear Regression, Ridge Regression, Random Forest, and
CatBoost.

Flask Web Application

A web interface was developed using the Flask framework. The interface allows users to
enter student information and obtain predicted math scores.

The system workflow is as follows:

User inputs student data

Data preprocessing →

Machine learning model prediction

Predicted math score displayed.

54
55
B.2 User Guide

This section explains how users interact with the system.

B.2.1 Starting the Application

Steps:

1. Open the project folder in terminal.


2. Run the Flask application.

python [Link]

3. Open browser and visit

[Link]

56
B.2.2 Loading Student Dataset

The system loads the trained machine learning model and uses it to generate predictions
based on input values.

The dataset was previously used during the training phase to build the regression model.

Example code used for loading dataset:

df = pd.read_csv("data/[Link]")

B.2.3 Performing Data Analysis

Before building the prediction system, exploratory data analysis was performed to understand
relationships between student attributes.

Analysis includes:

• Distribution of scores
• Gender comparison
• Race/ethnicity patterns
• Lunch type effect
• Test preparation course impact

57
58
59
B.2.4 Generating Visualizations

Visualization techniques were used to identify trends in the dataset.

Example:

[Link](data=df,x="average")

Visualizations help reveal patterns such as:

• Female students performing better overall


• Standard lunch improving performance
• Reading and writing scores strongly influencing math scores

B.2.5 Viewing Prediction Results

The Flask application provides a prediction form where users input student attributes.

Example inputs:

• Gender
• Race/Ethnicity
• Parental Level of Education
• Lunch Type
• Test Preparation Course
• Reading Score
• Writing Score

After submitting the form, the trained machine learning model predicts the math score.

Example prediction code:

prediction = [Link](input_data)

60
The predicted score is displayed on the web page.

61
B.3 Troubleshooting

If the Flask application does not run correctly, check the following:

• Ensure Flask library is installed


• Verify model file path
• Confirm dataset file location
• Restart Flask server

B.4 Best Practices

To maintain reliability of the system, the following best practices should be followed:

• Maintain proper project folder structure


• Use version control for code management
• Validate input data before prediction
• Regularly update machine learning models
• Test the application before deployment

62

You might also like