Program No. 1
Title
Implementation of Simple Linear Regression for CGPA vs Placement Package
Prediction
_______________________________________________
Aim
To study and implement Simple Linear Regression using Python to predict a
student’s placement package based on CGPA and visualize the dataset using a
scatter plot
_______________________________________________
Software / Tools Required
- Python
- NumPy
- Matplotlib
- Scikit-learn
_______________________________________________
Algorithm
- Start the program.
- Import the required Python libraries.
- Create a dataset consisting of CGPA and corresponding placement packages.
- Plot the dataset using a scatter plot to visualize the relationship.
- Create a Simple Linear Regression model.
- Train the model using the fit() method.
- Accept a CGPA value from the user.
- Predict the placement package for the given CGPA.
- Display the predicted result.
- Stop the program.
_______________________________________________
Programs Link -
Program 1- Simple Linear Regression - Simple_Linear_Regression.py
_______________________________________________
Input
CGPA value entered by the user
Example:
_______________________________________________
Output
1.
Plot the dataset (Scatter Plot)
2. Predicted placement package in LPA
·
The trained Linear Regression model predicts the
placement package for the given CGPA.
Predicted Package for CGPA 8.2
is: 6.13 LPA
_______________________________________________
Result
The Simple Linear Regression model
was successfully implemented to predict the placement package based on CGPA,
and the relationship between CGPA and package was visualized using a scatter
plot.
_______________________________________________
Conclusion
Simple Linear Regression
effectively predicts placement packages based on CGPA, showing a clear positive
linear relationship between academic performance and placement outcome.
_______________________________________________
Programs Link -
Program 2 - simple_linear_regression_coef_&_intercept
Title
Implementation of Simple Linear Regression for CGPA vs Placement Package
Prediction
_______________________________________________
Aim
To study and implement Simple Linear
Regression using Python to predict a student’s placement package based on CGPA,
visualize the dataset using a scatter plot, and display the regression
coefficient and intercept.
_______________________________________________
Software / Tools Required
- Python
- NumPy
- Matplotlib
- Scikit-learn
_______________________________________________
Algorithm
1)
Start the program.
2)
Import the required Python libraries.
3)
Create a dataset consisting of CGPA and corresponding
placement packages.
4)
Plot the dataset using a scatter plot.
5)
Create a Simple Linear Regression model.
6)
Train the model using the fit()
method.
7)
Accept CGPA input from the user.
8)
Predict the placement package for the given CGPA.
9)
Display the predicted package.
10) Display
the coefficient (slope) and intercept of the regression line.
11) Stop
the program.
_______________________________________________
Program 2
_______________________________________________
Input
CGPA value entered by the user
Example:
_______________________________________________
Output
1. Plot the dataset (Scatter Plot)
2. Predicted placement package in LPA
· The trained Linear Regression model predicts the placement package for the given CGPA.
Predicted Package for CGPA 8.2 is: 6.13 LPA
3.
Coefficient and Intercept Output
Coefficient (slope): 1.6049456575929804
Intercept: -7.034131020041879
_______________________________________________
Result
The Simple
Linear Regression model was successfully implemented to predict the placement
package based on CGPA. The relationship between CGPA and package was visualized
using a scatter plot, and the regression coefficient and intercept were
obtained.
_______________________________________________
Conclusion
Simple Linear Regression
effectively predicts placement packages based on CGPA and provides insight into
the linear relationship through the coefficient and intercept.
_______________________________________________
******************** >< ********************
Program No. 3
Title
Implementation of Simple Linear Regression for CGPA vs Placement Package
Prediction
_______________________________________________
Aim
To study and implement Simple Linear
Regression using Python to predict a student’s placement package based on CGPA,
visualize the dataset using a scatter plot and regression line, and display the
regression coefficient and intercept.
_______________________________________________
Software / Tools Required
- Python
- NumPy
- Matplotlib
- Scikit-learn
_______________________________________________
Algorithm
1)
Start the program.
2)
Import the required Python libraries.
3)
Create a dataset consisting of CGPA and corresponding
placement packages.
4)
Plot the dataset using a scatter plot.
5)
Create a Simple Linear Regression model.
6)
Train the model using the fit()
method.
7)
Accept CGPA input from the user.
8)
Predict the placement package for the given CGPA.
9)
Display the predicted package.
10) Display
the coefficient (slope) and intercept.
11) Predict
values for the regression line.
12) Plot
the scatter plot along with the regression line.
13) Stop
the program.
_______________________________________________
Programs Link -
Program 3 - Simple Linear Regression Draw Regression Line.py
_______________________________________________
Input
CGPA
value entered by the user
nput
CGPA value entered by the user
Example:
_______________________________________________
Output
1. Plot the dataset (Scatter Plot)
2. Predicted placement package in LPA
· The trained Linear Regression model predicts the placement package for the given CGPA.
Predicted Package for CGPA 8.2 is: 6.13 LPA
3. Coefficient and Intercept Output
Coefficient (slope): 1.6049456575929804
Intercept: -7.034131020041879
4.
Plot dataset and regression line
_______________________________________________
Result and Conclusion
The Simple Linear Regression model was successfully
implemented to predict the placement package based on CGPA. The scatter plot
displayed the actual data points, and the red regression line represented the
best-fit linear relationship between CGPA and package.
The predicted package, along with the regression
coefficient and intercept, was obtained correctly for the given input CGPA.
The regression line graph clearly shows a positive
linear relationship between CGPA and placement package. As the CGPA increases,
the placement package also increases proportionally. Thus, Simple Linear
Regression is an effective and reliable method for predicting placement
packages based on CGPA.
_______________________________________________

0 Comments