Unit No. 2
Unit No. 2
WHAT IS REGRESSION?
• Regression is a technique used to model and analyse the relationships between variables
and how they contribute and are related to producing a particular outcome together.
• Regression analysis is a form of predictive modelling technique which investigates the
relationship between a dependent (target) and independent variable(s) (predictor).
• Regression predict a real and continuous value y for a given set of input X (X = x1,x2,…)
• Regression is a Supervised Learning Technique
WHAT IS REGRESSION?
• The scatter plot below shows the number of college graduates in the US from the year
2001 to 2012.
WHAT IS REGRESSION?
• what if someone asks you how many college graduates with master's degrees will there
be in the year 2018?
WHAT IS REGRESSION?
• This problem will be solved by applying line fitting technique.
• This process of fitting a function to a set of data points is known as regression analysis.
• Regression analysis is the process of estimating the relationship between a dependent
variable and independent variables.
• In simpler words, it means fitting a function from a selected family of functions to the
sampled data under some error function.
• Using regression you fit a function on the available data and try to predict the outcome
for the future or hold-out datapoints.
WHAT IS REGRESSION?
• The simplest case to examine is one in which a variable Y, referred to as the dependent
or target variable, may be related to one variable X, called an independent or
explanatory variable, predictor variables or simply a regressor.
• In simplest terms, the purpose of regression is to try to find the best fit line or equation
that expresses the relationship between Y and X.
• A simplest way to express the linear relation between Y and X is to use a line equation.
• Y = θ0+ θ1*X
• The relationship is expressed in the form of an equation or a model connecting the
response or dependent variable and one or more explanatory or predictor variables.
• Example: predicting the price of a house given house features, predicting the sales based
on input parameters, predicting the weather, Predicting Stock prices etc.
REGRESSION FUNDAMENTALS
• Regression model establish relationship between Response/Dependent variable y with
the Independent /predictor variable x.
• We can write the relationship using a hypothesis function h as
• y = h(x)
• J(θ0, θ1 ) = MSE
2
• J(θ0, θ1 ) = 2
• Select θ0 and θ1 in such way that we will get minimum cost function.
• If 1. θ0 = 0 and θ1 =0.5 4. θ0 = 0 and θ1 = 1.5
2. θ0 = 0 and θ1 =0 5. θ0 = 0 and θ1 =2
3. θ0 = 0 and θ1 =1.2 6. θ0 = 0 and θ1 =1.6
what is h(x) and J(θ θ ) for above weights and which is best possible solution?
GRADIENT DESCENT