YouTube2Text

Support Vector Regression Indepth Maths Intuition In Hindi — Transcript

by Krish Naik Hindi · 1,894 words · 275 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Hello guys, my name is Krishna Naik and
  2. 0:01welcome to my YouTube channel. So guys,
  3. 0:03in today's video, we are going to
  4. 0:05discuss the Support Vector Regression
  5. 0:07machine learning algorithm. In our
  6. 0:09previous video, we looked at Support
  7. 0:11Vector Classification. I have already
  8. 0:13provided the link to the entire
  9. 0:15playlist in the description of every
  10. 0:16video. And to understand today's
  11. 0:18algorithm, it is very important that
  12. 0:20you first understand Support Vector
  13. 0:22Classification, guys. Because Support
  14. 0:24Vector Regression is an extension of
  15. 0:26that. Okay? But I will try to revise it
  16. 0:28for you and explain the entire thing
  17. 0:31once again. But try to watch the full
  18. 0:33Support Vector Classification video.
  19. 0:36Again, the link will be in the
  20. 0:37description. So, let me share my screen
  21. 0:40now and let's quickly understand what
  22. 0:42we did in Support Vector Classifier.
  23. 0:45Look, in Support Vector Classifier, we
  24. 0:47created a division line in combination
  25. 0:50with a marginal plane and a hyperplane.
  26. 0:53Right? What will that do? We will get
  27. 0:56properly classified points, and the
  28. 0:58cost function we wrote was w/2 + c,
  29. 1:01what would that be? c will be a
  30. 1:04hyperparameter for how many
  31. 1:06misclassifications we can avoid. Okay?
  32. 1:09After that, the summation of i = 1 to n
  33. 1:11of eta. We call this eta. What is eta?
  34. 1:14The summation of all the distances
  35. 1:15between all the wrong points up to the
  36. 1:17marginal plane. Okay? This could be a
  37. 1:19marginal plane. Otherwise, if the wrong
  38. 1:22points are here, we can find the
  39. 1:23distance to this marginal plane. Or, if
  40. 1:26this yellow point is a mistake, we can
  41. 1:29calculate this distance. So, what will
  42. 1:31we basically call this? We will call
  43. 1:33this a hyperparameter, and the
  44. 1:35hyperparameter always controls how our
  45. 1:37line should be formed here. Okay? So, I
  46. 1:41hope you understood this, and I gave
  47. 1:42the full explanation of how this cost
  48. 1:44function is formed in the previous
  49. 1:46video, and there was one more thing:
  50. 1:47the constraint. What is the constraint?
  51. 1:51That w transpose*x + b should always be
  52. 1:54greater than or equal to one. This was
  53. 1:57our constraint as well. We have
  54. 1:59discussed this completely in our SVC
  55. 2:01video. Now, in the case of regression,
  56. 2:03in the case of Support Vector
  57. 2:05Regression, how does this work? Now,
  58. 2:07look guys, this is Support Vector
  59. 2:08Regression. Okay? Let's say I have a
  60. 2:11data set like this where we have
  61. 2:13populated points for house size and
  62. 2:16price. So, what do we do with support
  63. 2:18vectors in this? The first thing with
  64. 2:20support vectors is that we create a
  65. 2:22best-fit line, just like how a linear
  66. 2:23regression line is created. Okay? Now,
  67. 2:26the second thing that will be created
  68. 2:29here, we will specifically call that a
  69. 2:31marginal plane of this type. Okay? So,
  70. 2:34I will draw the marginal plane here;
  71. 2:36let's say, for now, the marginal plane
  72. 2:38is like this. So, here is my marginal
  73. 2:41plane. Okay? Marginal plane. This is
  74. 2:46one marginal plane. This is one
  75. 2:47marginal plane. Now, to specify this
  76. 2:50marginal plane, what extra parameters
  77. 2:53do we use? You know that we can also
  78. 2:57write this line as w transpose x + b =
  79. 3:000. And let's say our b is zero. The
  80. 3:03intercept is passing through zero. So,
  81. 3:04we can define it directly by saying w
  82. 3:07transpose x. This line that we will
  83. 3:11discuss, we can represent it using an
  84. 3:13epsilon value. Let's say this point of
  85. 3:17mine populated behind here. Okay? This
  86. 3:19is my main intercept point. Let's say
  87. 3:22for now I can say b = 0, or I can write
  88. 3:25it in a different way too. Let's say we
  89. 3:27represent this line as w transpose x,
  90. 3:30okay? Now, the next hyper-plane from
  91. 3:33here, this distance we will call
  92. 3:35epsilon, and this distance we will also
  93. 3:37call epsilon; epsilon is equal.
  94. 3:39Whenever marginal planes are formed in
  95. 3:41SVC or SVR, these marginal planes are
  96. 3:43always formed at an equal distance.
  97. 3:45Right? Okay? So, this distance of the
  98. 3:48marginal plane is what we will call
  99. 3:49epsilon. So, we can basically write the
  100. 3:52top line as w transpose x + epsilon and
  101. 3:56the bottom line as w transpose x-
  102. 3:58epsilon. Okay? We can definitely write
  103. 4:01it in this way. Now, remember, why am I
  104. 4:04writing this? Because later you will
  105. 4:05also calculate the distance between
  106. 4:07these two. Right? So, the cost function
  107. 4:09we will get, the cost function that
  108. 4:11will come, will be the same thing we
  109. 4:14did initially in SVC. That is minimized
  110. 4:17by changing w and b. w/2, this distance
  111. 4:22, we always have to minimize. When we
  112. 4:25minimize, that basically means we are
  113. 4:27having the maximum distance. Now,
  114. 4:29besides this, we will write a
  115. 4:31constraint because we wrote a different
  116. 4:33constraint in SVC. Why? Here we had to
  117. 4:36find the classification for all the
  118. 4:37correct points. For most of the
  119. 4:39accurate points. Accurate points means,
  120. 4:41let's understand how the prediction
  121. 4:42will happen here? Look, if you see
  122. 4:45according to this point, the truth
  123. 4:47value is here. But where will the
  124. 4:49predicted value be? Let's say the
  125. 4:51predicted value came here, here, or
  126. 4:53wherever? It came between the two.
  127. 4:55Let's say my predicted point is coming
  128. 4:57here. So, what should be its distance,
  129. 5:00and how will we calculate the distance?
  130. 5:03You can write it directly. Right? You
  131. 5:05can write y-w transpose x of i. Okay? w
  132. 5:09transpose x of i basically became my
  133. 5:11predicted point. It should be less than
  134. 5:14or equal to epsilon. Okay? So I will
  135. 5:17quickly explain to you again what I
  136. 5:19have done here, and you will get the
  137. 5:21whole idea from this. This is the
  138. 5:23entire support vector machine algorithm
  139. 5:25that I discussed. Right now, we are
  140. 5:27here. So here, the constraint will be
  141. 5:30written as y of i-w transpose x of i.
  142. 5:33This is basically my y-hat. Now the
  143. 5:35difference between these two should
  144. 5:37always remain below epsilon. It can be
  145. 5:39+ epsilon, it can be-epsilon. Always
  146. 5:41this distance, so here you can see this
  147. 5:43distance is always less. It is less
  148. 5:45than epsilon. So what does this mean?
  149. 5:47These points that we predicted are very
  150. 5:50good. It is very good. Okay? And
  151. 5:55usually, whenever we talk about
  152. 5:57regression, we discuss the mean squared
  153. 6:00error as the loss function. But here,
  154. 6:03look, we will specifically call this a
  155. 6:05constraint. Our constraint should
  156. 6:09always be y of i-w transpose x of i,
  157. 6:12which we call y-hat. It should be less
  158. 6:16than epsilon. Okay? So this became the
  159. 6:19constraint in the cost function for SVR
  160. 6:20because this is a frequent interview
  161. 6:22question, guys. Recently, this was also
  162. 6:24asked at Amazon. Okay? About all these
  163. 6:27things. Now, the next thing to
  164. 6:29understand is, okay, Krish, that is
  165. 6:31fine. You are saying that, okay? All
  166. 6:33your points should be within this +
  167. 6:36epsilon and-epsilon. But what about
  168. 6:38those points that are outside this? For
  169. 6:42those, how will you decide the cost
  170. 6:44function? Okay? How will you decide the
  171. 6:46cost function for these? So, I will
  172. 6:48write the cost function again here. Now
  173. 6:50, our cost function will be modified
  174. 6:52slightly. The points that exist outside
  175. 6:54. We will write it as minimize by
  176. 6:57changing W and b. /2 plus. Do you
  177. 7:02remember we used two parameters in
  178. 7:04classification? C and the summation of
  179. 7:08i = 1 to N, and here we will have eta
  180. 7:12of i, okay? We can call it mod of eta i
  181. 7:15. Okay? Because whenever we calculate
  182. 7:17distance. Now, what are this C and this
  183. 7:20eta of i? See, C means how many points
  184. 7:23outside the marginal plane we can
  185. 7:26adjust. If I say there are five points
  186. 7:29here. Okay? Then these five points can
  187. 7:31be outside. I will call this eta of i.
  188. 7:34The distance between the marginal plane
  189. 7:36and this particular point. Okay? Its
  190. 7:38summation should also be as small as
  191. 7:40possible. So in short, both of these
  192. 7:42are specifically hyperparameters. Okay?
  193. 7:45We call both of these hyperparameters.
  194. 7:48We call them hyperparameters. If we
  195. 7:50talk about SVC, we also call this hinge
  196. 7:53loss. Hinge loss. Okay? Now, but there
  197. 7:57is a very important thing that if I am
  198. 8:00writing this, its constraint will also
  199. 8:02change a bit. Because we haven't
  200. 8:04included this eta of i in the
  201. 8:05constraint, because it is the distance
  202. 8:07from the marginal plane to this outside
  203. 8:10point, the distance of this marginal
  204. 8:11plane to this particular marginal plane
  205. 8:14, sorry, these points to the marginal
  206. 8:16plane. So we will have to add one more
  207. 8:18constraint here. We will now modify
  208. 8:20this constraint slightly. What did we
  209. 8:23write earlier? y of i*w transpose x of
  210. 8:26i, and this should be less than or
  211. 8:28equal to epsilon. We had written this
  212. 8:31much earlier, but now when we have this
  213. 8:34value, eta, what will happen? + eta i
  214. 8:37will be added here. Okay, whatever eta
  215. 8:41we are getting here, + eta i will be
  216. 8:43added here. Now look, if I plot these
  217. 8:46points and tell you where epsilon and
  218. 8:48eta are in a very simple way, you will
  219. 8:51get the complete idea. The distance
  220. 8:54from here to here for these points, we
  221. 8:56will call it epsilon. Okay? But this
  222. 8:59point here is above the marginal plane.
  223. 9:01So what will we do? We will add one
  224. 9:04more parameter here with eta. We call
  225. 9:07it eta i. Because what will eti be? It
  226. 9:09is the distance from the marginal plane
  227. 9:11to this specific data point. So when we
  228. 9:14add both of these, always remember that
  229. 9:17our y-y of i w of x of i should be less
  230. 9:20than epsilon plus this. So it should
  231. 9:24remain less than this distance. So we
  232. 9:26will specifically call this a
  233. 9:28hyperparameter and we will try to play
  234. 9:30with different c-values. Okay? So let
  235. 9:33me draw it for you in a simpler way.
  236. 9:36Let's say my data points are something
  237. 9:38like this. Okay? Like this. So here I
  238. 9:43have created a best-fit line. Now with
  239. 9:45the best-fit line, I have created two
  240. 9:47marginal planes like this. Okay? Let's
  241. 9:49say. And these two marginal planes will
  242. 9:51basically be defined by the intercept
  243. 9:52from here. And we will use the same
  244. 9:54cost function. The distance of this
  245. 9:57point from here is epsilon. And let's
  246. 9:59assume there is an additional point
  247. 10:01above it. So, from this distance to
  248. 10:04that distance, we will call it—
  249. 10:06specifically—sorry, not from here to
  250. 10:09here—so we will call the distance
  251. 10:11from here to here 'eta of i'. Now, when
  252. 10:14we add both of these, whenever we make
  253. 10:16a prediction, it should always be less
  254. 10:18than this for any data point, because
  255. 10:20if I make a prediction for a data point
  256. 10:22from here, it will come here. Right? It
  257. 10:24will come here. And we always have to
  258. 10:26make sure it is always less than
  259. 10:28epsilon + eta. Okay? So this, this is
  260. 10:31the constraint. We play with different
  261. 10:34c-values. We can basically use this as
  262. 10:37a hyperparameter and we can select it
  263. 10:39accordingly. I will explain in
  264. 10:41GridSearch CV how support vector
  265. 10:43regression works. So I hope you all
  266. 10:45liked this video very much. I hope you
  267. 10:48understood what I am trying to explain.
  268. 10:50But to understand this properly, it is
  269. 10:51very important for you to understand
  270. 10:53the support vector classifier. I have
  271. 10:54put the link to that in the description
  272. 10:56. I hope you liked this video. I will
  273. 10:57see you all in the next video. Have a
  274. 10:59great day. Thank you, everyone. Bye-bye
  275. 11:00.

About this transcript

This page contains the full transcript of Support Vector Regression Indepth Maths Intuition In Hindi by Krish Naik Hindi, generated from the public captions YouTube serves with the video. The transcript has 1,894 words across 275 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.