0% found this document useful (0 votes)
7 views2 pages

EXPERIMENT2

This document outlines an experiment aimed at deploying Simple Linear Regression to model the relationship between two variables, specifically predicting salaries based on years of experience. It details the steps involved in the process, including data exploration, model training, predictions, and performance evaluation using MSE and R-squared scores. The conclusion emphasizes the effectiveness of the technique and the successful implementation of the model.

Uploaded by

naamkuchbhi480
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)
7 views2 pages

EXPERIMENT2

This document outlines an experiment aimed at deploying Simple Linear Regression to model the relationship between two variables, specifically predicting salaries based on years of experience. It details the steps involved in the process, including data exploration, model training, predictions, and performance evaluation using MSE and R-squared scores. The conclusion emphasizes the effectiveness of the technique and the successful implementation of the model.

Uploaded by

naamkuchbhi480
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/ 2

EXPERIMENT – 2

AIM: Deploying Simple Linear Regression in Machine Learning


THEORY: The objective of this experiment is to understand and implement Simple Linear
Regression to model the relationship between two variables and deploy the model for
predictions.
Simple Linear Regression is a fundamental supervised learning algorithm used to predict the
dependent variable (Y) based on the independent variable (X). The relationship between these
variables is represented by the equation:
Where:
• is the dependent variable (output)
• is the independent variable (input)
• is the slope of the regression line
• is the intercept
The goal of Simple Linear Regression is to find the best-fit line that minimizes the sum of
squared residuals (differences between actual and predicted values).
Steps to Deploy Simple Linear Regression:
1. Import Required Libraries
2. Load the Dataset
3. Explore the Dataset
4. Split the Dataset into Training and Testing Sets
5. Train the Model using Simple Linear Regression
6. Make Predictions
7. Visualize the Results
8. Evaluate Model Performance
Observations and Results:
1. Model Training: The model learns the relationship between experience and salary.
2. Prediction: The model predicts salaries based on experience values from the test set.
3. Exploration: The dataset was explored with statistical summaries and data types.
4. Visualization: The regression line fits the training data well.
5. Evaluation: The model is evaluated using MSE and R-squared scores.

2237804
CODE:

Conclusion:
Simple Linear Regression is an effective technique for modeling relationships between two
variables. In this experiment, we successfully trained and deployed a linear regression model
to predict salaries based on years of experience. The model's performance was evaluated
using MSE and R-squared score, demonstrating its accuracy in making predictions. Data
exploration steps further helped in understanding the dataset characteristics before applying
the model.

2237804

You might also like