Sunday, March 31, 2024

STAIR ONE: LINEAR REGRESSION

 LINEAR REGRESSION

One of the simplest and most often used machine learning methods is linear regression. It's a statistical technique for forecasting analysis. Linear regression produces predictions for continuous/real or numerical variables such as age, product price, sales, and so on.

The term "LINEAR REGRESSION" refers to a procedure that displays a linear connection between one or more independent (y) variables and a dependent (y) variable. Given that it displays a linear connection, linear regression determines how the value of the dependent variable varies in response to the value of the independent variable.

The link between the variables is represented by a skewed straight line according to the linear regression model. Take a look at the picture below:

In Machine Learning, Linear Regression
A linear regression can be mathematically represented as:





y= a0+a1x+ ε

Here,

Y= Dependent Variable (Target Variable)
X= Independent Variable (predictor Variable)
a0= intercept of the line (Gives an additional degree of freedom)
a1 = Linear regression coefficient (scale factor to each input value).
ε = random error

Simple Linear Regression: If a single independent variable is used to predict the value of a numerical dependent variable, then such a Linear Regression algorithm is called Simple Linear Regression.

  • Strength of the relationship between the specified variables.
  • Example: An illustration of this would be the link between rising temperatures and pollution levels.
  • The independent variable's value determines the dependent variable's value.
  • Example: An illustration would be the pollution level at a particular temperature.

  • Above diagram is taken from the notebook in which linear regression model is performed on the Dataset of employees of random company which includes their Year of experiences and Salary.
    Where year of experiences is independent variable and salary is dependent variable.
     
    In Jupyter notebook First, all libraries whichever are needed are defined. Like pandas, seaborn, matplotlib. Then data is split into train and test dataset. Then the model is implemented. For model implementing linear regression library also should defined. which can be called through sklearn.linear_model which is a free and open source ML library for python.


    As, I previously said during the journey I will take readers through hand on journey. I am providing the link of folder which is freely accessible where I have posted various documents in which i have implemented the model on easiest level. Any beginner can easily understand the models.
    Those models are implemented in "Jupyter notebook" which is the platform for implementing python projects. 


    Kindly, refer the link provided below:

    References:

    [1]https://www.javatpoint.com/linear-regression-in-machine-learning


    No comments:

    Post a Comment

    Probability and Statistical Operation Using Python

     STATISTICS AND POBABILITY  STATISTICS: The process of gathering information, tabulating it, and interpreting it numerically is known as sta...