This Python script uses linear regression to predict student marks based on the number of study hours. It uses the pandas
, numpy
, math
, matplotlib
, and scikit-learn
libraries to perform data manipulation, visualization, and modeling.
Make sure you have the following Python libraries installed:
- pandas
- numpy
- math
- matplotlib
- scikit-learn
You can install them using pip
if you haven't already:
pip install pandas numpy matplotlib scikit-learn
-
Clone or download the repository to your local machine.
https://github.com/tsameema/StudySmartScore
-
Run the script
student_marks_prediction.py
.python student_marks_prediction.py
The script will:
- Load the student data from an online CSV file.
- Split the data into training and testing sets.
- Fit a linear regression model to predict student marks based on study hours.
- Display a scatter plot of the original data and the regression line.
- Make predictions on the test set and calculate the Mean Squared Error (MSE).
- Display a scatter plot comparing the actual student marks and predicted marks.
- Allow you to input a number of study hours to predict the corresponding student marks.
- After running the script, you will see the predicted score for the given number of study hours.
No of Hours = [[9.25]]
Predicted Score = [93.69173249]