Can someone explain to me the difference between a cost function and the gradient descent equation in logistic regression

0 votes
I'm not able to understand the difference between the cost function and the gradient. There are examples on the net where people compute the cost function and then there are places where they don't and just go with the gradient descent function w :=w - (alpha) * (delta)w * f(w).

What is the difference between the two if any?
Feb 15, 2022 in Machine Learning by Nandini
• 5,480 points
913 views

1 answer to this question.

0 votes
when we train a model with data, we actually produce some values i.e.; predicted values for a specific feature. But, that specific feature has actual values in the data set. Thus, we we try to keep the predicted values closer to the real values, this ensures better model accuracy and predictions.
We use cost function to measure how close is the prediction of the model i.e.  how close are the predicted values to their corresponding real values in the data set.

The weights in the trained model are responsible for predicting the new values accurately.
For Example:
model is
Y = 0.4*X + 0.2, the predicted value will be
(0.4*X + 0.2) the values of X will vary.
Hence, if we consider y as real value corresponding to x, the cost formula will measure how close (0.4*X + 0.2) is to y
We need to find the weight (0.4 and 0.2) for our model to come up with a lowest cost (or closer predicted values to real ones).

One of the optimization algorithm is Gradient descent and it tries to find the minimum cost value in the process of experimenting with alternative weights or updating weights.

We start by running our model with some starting weights, then using gradient descent to update our weights and estimate the cost of our model with those weights over thousands of iterations to get the lowest cost.
Gradient Descent is used for weight updating.
answered Feb 15, 2022 by Dev
• 6,000 points

Related Questions In Machine Learning

0 votes
1 answer
0 votes
1 answer

What is the difference between linear regression and logistic regression?

Hi Dev, to answer your question Linear Regression ...READ MORE

answered Feb 2, 2022 in Machine Learning by Nandini
• 5,480 points
1,183 views
0 votes
1 answer

Can we change the sigmoid with tanh in Logistic regression transforms??

Hi@Deepanshu, Yes, you can use tanh instead of ...READ MORE

answered May 12, 2020 in Machine Learning by MD
• 95,460 points
2,729 views
0 votes
1 answer

Difference between classification and regression score in Python scikit learn

Classification Score is used for discrete values ...READ MORE

answered Feb 24, 2022 in Machine Learning by Nandini
• 5,480 points
609 views
0 votes
1 answer

Use different distance formula other than euclidean distance in k means

K-means is based on variance minimization. The sum-of-variance formula ...READ MORE

answered Jun 21, 2018 in Data Analytics by Sahiti
• 6,370 points
1,657 views
0 votes
1 answer

Overfitting vs Underfitting

In statistics and machine learning, one of ...READ MORE

answered Jul 11, 2018 in Data Analytics by CodingByHeart77
• 3,750 points
1,189 views
+1 vote
1 answer

How to handle Nominal Data?

Nominal data is basically data which can ...READ MORE

answered Jul 24, 2018 in Data Analytics by Abhi
• 3,720 points
653 views
+2 votes
2 answers

How to handle outliers

There are multiple ways to handle outliers ...READ MORE

answered Jul 24, 2018 in Data Analytics by Abhi
• 3,720 points
959 views
0 votes
1 answer

Is there any difference between an activation function and a transfer function?

Transfer function and Activation function with respect ...READ MORE

answered Feb 21, 2022 in Machine Learning by Dev
• 6,000 points
3,766 views
0 votes
1 answer

What is difference between loss function and RMSE in Machine Learning?

The loss function is a function of ...READ MORE

answered Feb 23, 2022 in Machine Learning by Dev
• 6,000 points
2,881 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP