0% found this document useful (0 votes)
5 views4 pages

DRA Lab Exp5

The document outlines an experiment to implement a linear regression model using Python to analyze the relationship between the number of projects completed by students and their academic scores. It includes source code for loading a dataset, training the model, and predicting scores based on the number of projects. The results indicate a successful execution of the model, providing insights into student performance based on project participation.

Uploaded by

bborigarla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

DRA Lab Exp5

The document outlines an experiment to implement a linear regression model using Python to analyze the relationship between the number of projects completed by students and their academic scores. It includes source code for loading a dataset, training the model, and predicting scores based on the number of projects. The results indicate a successful execution of the model, providing insights into student performance based on project participation.

Uploaded by

bborigarla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

DATE:

EXPRIMENT-5
Linear regression
AIM: To implement python program by using Linear Regression .

SOURCE CODE:

import pandas as pd

from sklearn.linear_model import LinearRegression

# Load the dataset

data = pd.read_csv('student_scores.csv')

# Prepare the data

X = data[['projects']] # Feature

y = data['score'] # Target

# Train the Linear Regression Model

model = LinearRegression().fit(X, y)

# Print the linear regression equation

print(f"Score = {model.coef_[0]:.2f} * Projects + {model.intercept_:.2f}")

# Make Predictions and display them

data['Predicted Score'] = model.predict(X)

print("\nPredicted Scores:")

print(data[['student', 'projects', 'score', 'Predicted Score']])


DATASET DESCRIPTION:
This dataset contains information about the performance of five students in relation to the number of
projects they have completed. It includes the following columns:
 student: The name of the student.
 projects: The total number of projects each student has completed.
 score: The performance score achieved by each student, which reflects their academic success.
The dataset can be utilized to analyze how the number of projects completed influences student
performance, providing insights into the correlation between active participation in projects and
academic outcomes.
Data give below:

student project score

Lokeswar 3 75

Ratnam 2 60

Vignesh 5 88

Rajeev 4 82

Ganesh 3 70

. Save data set by ‘student_scores.csv’.

OUTPUT:

Score = 6.50 * Projects + 54.00


Predicted Score:

student project score Predicted score

Lokeswar 3 75 73.00

Ratnam 2 60 60.50

Vignesh 5 88 87.00

Rajeev 4 82 83.50

Ganesh 3 70 73.00

RESULT:
Linear Regression model is developed by using Student and Score data set is successfully executed.

You might also like