How to use the J(θ0​,θ1​)=2m1​i=1∑m​(y^​i​−yi​)2=2m1​i=1∑m​(hθ​(xi​)−yi​)2 formula in machine learning? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to use the J(θ0​,θ1​)=2m1​i=1∑m​(y^​i​−yi​)2=2m1​i=1∑m​(hθ​(xi​)−yi​)2 formula in machine learning?

J(θ0​,θ1​)=2m1​i=1∑m​(y^​i​−yi​)2=2m1​i=1∑m​(hθ​(xi​)−yi​)2 How to use this fornula in linear regression ??m

19th Feb 2021, 10:45 AM
K.S.S. Karunarathne
K.S.S. Karunarathne - avatar
1 Answer
0
The formula is not readable. but usually cost function is used to modify weights to give more accurate results. It represents the difference between the current predicted output h​(x_i​) and original true result(from data set) y_i. i represent data example such as 1,2,3..... if h​(x_i​) - y_i is high it means error is high so weights will be manipulated more dramatically . for example true result is 5 but we predicted 8, result will be 8-5 = 3. But when true result is 8 and we predict 5 result will be -3 to avoid this we have to take square of result (h​(x_i​) - y_i)^2 or another approach is using absolute value such as abs(h​(x_i​) - y_i)
14th Mar 2021, 10:13 AM
deleted