{"id":6744,"date":"2021-01-22T07:04:09","date_gmt":"2021-01-22T01:34:09","guid":{"rendered":"https:\/\/copyassignment.com\/?p=6744"},"modified":"2022-08-09T20:12:43","modified_gmt":"2022-08-09T14:42:43","slug":"gradient-descent-linear-regression","status":"publish","type":"post","link":"https:\/\/copyassignment.com\/gradient-descent-linear-regression\/","title":{"rendered":"Gradient Descent: Another Approach to Linear Regression"},"content":{"rendered":"\n<p>In the last tutorial, we learned about our first ML algorithm called Linear Regression. We did it using an approach called Ordinary Least Squares, but there is another way to approach it. It is an approach that becomes the basis of Neural Networks, and it&#8217;s called <strong>Gradient Descent<\/strong>. And don&#8217;t get intimidated by the name because the approach is actually quite easy and we&#8217;ll understand how to implement it using sklearn too.<\/p>\n\n\n\n<p>It&#8217;s recommended that you know the basics of multivariable calculus, if you are not familiar with it you can learn it <strong><a aria-label=\" (opens in a new tab)\" class=\"rank-math-link\" href=\"https:\/\/www.khanacademy.org\/math\/multivariable-calculus\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a><\/strong>. It&#8217;ll be better if you understand Linear Regression Intuition, you can read our tutorial about it <strong><a aria-label=\" (opens in a new tab)\" class=\"rank-math-link\" href=\"https:\/\/copyassignment.com\/linear-regression-machine-learning\/\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a><\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Intuition Behind Gradient Descent<\/h2>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>So in machine learning, we usually try to optimize our algorithms like we try to adjust the parameters of the algorithm in order to achieve the optimal parameters that give us the minimum value of the loss function. So where does Gradient Descent helps in optimization, and more importantly, what does it do?<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Gradient Descent is an optimization algorithm that is used to find the local minima of a differentiable function.<\/p><\/blockquote>\n\n\n\n<p>If the above statement didn&#8217;t make much sense it&#8217;s fine I&#8217;ll break it down. The first part says <em>Gradient Descent is an optimization algorithm<\/em> which means we can use it to optimize our model parameters we&#8217;ll understand how but now it&#8217;s clear why we need it.<\/p>\n\n\n\n<p>The second part says that <em>it is used to find the <strong>local minima<\/strong> of a <strong>differentiable function.<\/strong><\/em> Well&#8230;..that&#8217;s a big statement. Let&#8217;s start by understanding what exactly a differentiable function is. Well simply put a differentiable function is a function that can be differentiated and graphically its function whose graph is smooth and doesn&#8217;t have a break, angle, or cusp. Refer to the picture below to understand it a bit clearer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/i2.wp.com\/violet-cat-415996.hostingersite.com\/wp-content\/uploads\/2021\/01\/Untitled-5.jpg?fit=1024%2C576&amp;ssl=1\" alt=\"differentiable vs non differentiable function\" class=\"wp-image-6748 lazyload\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/Untitled-5.jpg 1920w, https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/Untitled-5-300x169.jpg 300w, https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/Untitled-5-1024x576.jpg 1024w, https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/Untitled-5-768x432.jpg 768w, https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/Untitled-5-1536x864.jpg 1536w, https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/Untitled-5-1026x577.jpg 1026w, https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/Untitled-5-675x380.jpg 675w\" data-sizes=\"(max-width: 1920px) 100vw, 1920px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1920px; --smush-placeholder-aspect-ratio: 1920\/1080;\" \/><\/figure>\n\n\n\n<p>Now as you can see the graph with that pointy angle thing in (0,0) is not differentiable and the smooth curve on the left is. Now refer to the following image for a refresher on local and global minima and maxima.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Local-Maximum-2-1024x670.png\" alt=\"Local and Global maximum and minimum\" class=\"wp-image-16289 lazyload\" width=\"768\" height=\"503\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Local-Maximum-2-1024x670.png 1024w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Local-Maximum-2-300x196.png 300w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Local-Maximum-2-768x503.png 768w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Local-Maximum-2-1026x672.png 1026w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Local-Maximum-2-675x442.png 675w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Local-Maximum-2.png 1080w\" data-sizes=\"(max-width: 768px) 100vw, 768px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 768px; --smush-placeholder-aspect-ratio: 768\/503;\" \/><figcaption>Local and Global maximum and minimum<\/figcaption><\/figure>\n\n\n\n<p>Now that we have everything cleared out let&#8217;s start by understanding gradient descent with a classic example of the mountaineer. So let&#8217;s imagine that we have our friend john who reached the top of Mount Everest. Wow, that&#8217;s something to be proud of but now he needs to reach the bottom so John starts taking steps in the direction that point to the bottom of the mountain something like this:-<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"300\" height=\"263\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/image-72.png\" alt=\"bottom in gradient descent, multivariable calculus\" class=\"wp-image-6757 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 300px; --smush-placeholder-aspect-ratio: 300\/263;\" \/><\/figure>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>Now at each step, he had multiple directions to choose to take a step in but he chose to take the steps in the direction that leads to the bottom. If you&#8217;re familiar with multivariable calculus you&#8217;ll know that gradient is the value that gives you the direction of the steepest increase and its negative value gives you the direction of the step that decreases the value of the function quickly or the steepest descent.<\/p>\n\n\n\n<p>Gradient Descent starts with random inputs and starts to modify them in such a way that they get closer to the nearest local minima after each step. But won&#8217;t it be better to achieve global minima? It&#8217;ll be but gradient descent can&#8217;t, gradient descent can only the nearest local minima. And as you might have guessed if a function has multiple local minima then the one chosen by Gradient Descent depends on the random input we choose at the beginning.<\/p>\n\n\n\n<p>Hence in a nutshell the idea behind Gradient Descent is to take the steps in the direction of the steepest decrease,i.e. the opposite direction of the&nbsp;gradient, of the function at the current point. <\/p>\n\n\n\n<p>But what is our function? What is its input? If we can&#8217;t achieve global minima then how does gradient descent optimize it? <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Linear Regression using Gradient Descent<\/h2>\n\n\n\n<p>If you&#8217;ve read the previous article you&#8217;ll know that in Linear Regression we need to find the line that best fits the curve. That line was given by the following Hypothesis:-<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"247\" height=\"87\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/1-3.png\" alt=\"Linear Regression using Gradient Descent hypothesis\" class=\"wp-image-16290 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 247px; --smush-placeholder-aspect-ratio: 247\/87;\" \/><figcaption>Linear Regression using Gradient Descent hypothesis<\/figcaption><\/figure>\n\n\n\n<p>our aim was to find the parameters \u03b80, \u03b81,&#8230;,\u03b8n. Now in OLS we simply had a formula that when fed the input found the \u03b8 matrix. But in gradient descent, we start by taking the random values of the parameters and then keep on modifying them until we find the value of parameters close to the local minimum of the function. WAIT! What is this function? <\/p>\n\n\n\n<p>Well, my bad let me explain. The aim of linear regression is to find the best fit line but how do you define the best fit line? Well, the best-fit line was the line that when placed in the scatter plot had all the points as close to it as possible. But how do you measure this mathematically?<\/p>\n\n\n\n<p>We can define a function to find out how well our line&#8217;s predictions are w.r.t. to the training set and for that we&#8217;ll use a <strong>metric <\/strong>called <strong>Mean Squared Error<\/strong> or MSE for short. Wow, that&#8217;s a weird name. Let me explain. <strong>Mean squared error<\/strong> is defined as the mean of the sum of the square difference between the predicted value of the target and the actual value of the target. It is calculated with the following formula:-<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/2-3.png\" alt=\"Mean squared error\" class=\"wp-image-16291 lazyload\" width=\"447\" height=\"91\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/2-3.png 894w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/2-3-300x61.png 300w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/2-3-768x156.png 768w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/2-3-675x137.png 675w\" data-sizes=\"(max-width: 447px) 100vw, 447px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 447px; --smush-placeholder-aspect-ratio: 447\/91;\" \/><figcaption>Mean squared error<\/figcaption><\/figure>\n\n\n\n<p>And this is the function whose value we have to minimize using Gradient Descent. In short, we have to find the value of the parameters closest to the local minima of the MSE function. <\/p>\n\n\n\n<p>But local minima differ based on the value of starting point of parameters? Yes and that&#8217;s why we try to use a loss function that has only one local minimum and that local minimum is the global minimum. So no matter the starting point we&#8217;ll just be stepping in the direction of the global minimum.<\/p>\n\n\n\n<p>MSE fits the description it has only one minimum and that is the global minimum. Now that we have the above stuff cleared let&#8217;s start talking about the steps in Gradient Descent.<\/p>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Step 1: Specifying Initial Parameters<\/h3>\n\n\n\n<p>We start by randomly assigning values to our parameters. This will be the starting point in the curve, you can assign all the values as 0 or randomly assign them any values it&#8217;s up to you.<\/p>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Step 2: Find Partial Derivative of Cost Function<\/h3>\n\n\n\n<p>To execute the gradient descent step you need to find the partial derivation of the cost function w.r.t. to each parameter. Calculating a partial derivative is similar to normal derivation except in this case we only calculate only the variable w.r.t. whom the partial derivative is being calculated and treat all other variables as constant. See the following example to understand better:-<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"257\" height=\"233\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/image-74.png\" alt=\"partial derivative with respect to x\" class=\"wp-image-6760 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 257px; --smush-placeholder-aspect-ratio: 257\/233;\" \/><\/figure>\n\n\n\n<p>As you can see in the partial derivative w.r.t. x we only took the derivative of the first term and treated y and z as constant and did the same for the partial derivative w.r.t. y where we took the derivative of the second term and treated x and z constant.<\/p>\n\n\n\n<p>Now let&#8217;s calculate the derivative of our loss function we&#8217;ll call J(\u03b8) for simplicity. J(\u03b8) is nothing but the MSE function.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"705\" height=\"332\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/image-81.png\" alt=\"calculate the derivative \" class=\"wp-image-6819 lazyload\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/image-81.png 705w, https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/image-81-300x141.png 300w, https:\/\/copyassignment.com\/wp-content\/uploads\/2021\/01\/image-81-675x318.png 675w\" data-sizes=\"(max-width: 705px) 100vw, 705px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 705px; --smush-placeholder-aspect-ratio: 705\/332;\" \/><\/figure>\n\n\n\n<p>As we can see the predicted value, \u0177 depends on the parameters<\/p>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Step 3: The Gradient Descent Step <\/h3>\n\n\n\n<p>Now that we have our partial derivative we are all set to do our gradient descent step. So a typical gradient descent step looks like this:-<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"527\" height=\"411\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/gradiant_descent.jpg\" alt=\"The Gradient Descent Step \" class=\"wp-image-16292 lazyload\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/gradiant_descent.jpg 527w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/gradiant_descent-300x234.jpg 300w\" data-sizes=\"(max-width: 527px) 100vw, 527px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 527px; --smush-placeholder-aspect-ratio: 527\/411;\" \/><figcaption>The Gradient Descent Step <\/figcaption><\/figure>\n\n\n\n<p>Great, that means at each iteration of Gradient Descent we update our parameters by subtracting the product of our partial derivative and that weird alpha symbol from it. But you might be confused regarding what that alpha is used for. That alpha is a vital <strong>hyperparameter<\/strong> called the Learning Rate. It basically defines how fast we achieve convergence or local minima point. <\/p>\n\n\n\n<p>If the learning rate is too low then the convergence will be slow and if it&#8217;s too high the value of loss might overshoot. Hence it&#8217;s important to find an optimal learning rate. Usually, we start from 0.1 and keep updating it by dividing it by 10 until the optimal rate is found. Like : 0.1, 0.01, 0.001, &#8230;<\/p>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Step 4: Repeat until Convergence<\/h3>\n\n\n\n<p>Repeat step 3 for x epochs or iterations. Assuming the learning rate is optimal with each epoch your training loss keeps reducing. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Gradient Descent using sklearn<\/h2>\n\n\n\n<script async=\"\" src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\" style=\"display:block; text-align:center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-9886351916045880\" data-ad-slot=\"2002566052\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<p>In sklearn, Linear Regression in linear_model uses OLS to find the values of parameters but to use Linear Regression using Gradient Descent we use <strong>SGDRegressor <\/strong>present in <strong>linear_model<\/strong>. SGD stands for Stochastic Gradient Descent. We\u2019ll use the diabetes dataset present in sklearn, in that dataset is a dictionary with features matrix under key data and&nbsp;<strong>target vector<\/strong>&nbsp;under key target. So let\u2019s start by loading the data.<\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"python\" data-theme=\"xcode\" data-fontsize=\"14\" data-lines=\"Infinity\" data-showlines=\"true\" data-copy=\"false\">#Importing the libraries\nimport numpy as np\nfrom sklearn.datasets import load_diabetes\n\n#Loading the diabetes dataset\ndiabetes = load_diabetes()\n\nX = diabetes.data\nY = diabetes.target<\/pre><\/div>\n\n\n\n<p>Now that we have our data let\u2019s create our <strong>SGDRegressor<\/strong> object and train it on the data. To train the data we use&nbsp;the <strong>fit()&nbsp;<\/strong>method as usual. <strong>max_iter<\/strong> is used to define the max epochs and <strong>alpha<\/strong> is used to set the learning rate.<\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"python\" data-theme=\"xcode\" data-fontsize=\"14\" data-lines=\"Infinity\" data-showlines=\"true\" data-copy=\"false\">#Loading the data to the model\nfrom sklearn.linear_model import SGDRegressor\nreg = SGDRegressor(max_iter= 10000, alpha=0.0001)\nreg.fit(X,Y)<\/pre><\/div>\n\n\n\n<p>Now let\u2019s check how accurate the model is by finding the RMSE value. For this model, it came out to be 54.03.<\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"python\" data-theme=\"xcode\" data-fontsize=\"14\" data-lines=\"Infinity\" data-showlines=\"true\" data-copy=\"false\">#Calculating the mean square error\nfrom sklearn.metrics import mean_squared_error\ny_pred = reg.predict(X)\nprint(np.sqrt(mean_squared_error(Y, y_pred)))<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Gradient Descent Variants<\/h2>\n\n\n\n<p>There are two categories of Gradient descent which include Stochastic Gradient Descent and Batch Gradient Descent<\/p>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Stochiastic Gradient Descent<\/h3>\n\n\n\n<p>In this method, the parameters are updated with the computed gradient for each training point at a time. So, at a time a single training point is used and its corresponding loss is computed. The parameters are updated after every training sample.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Algorithm for stochastic gradient descent<\/h4>\n\n\n\n<p>As mentioned, this algorithm takes one example per iteration. Let (x(I), y(I) be the training sample<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/5-4.png\" alt=\"stochastic gradient descent\" class=\"wp-image-16296 lazyload\" width=\"481\" height=\"244\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/5-4.png 481w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/5-4-300x152.png 300w\" data-sizes=\"(max-width: 481px) 100vw, 481px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 481px; --smush-placeholder-aspect-ratio: 481\/244;\" \/><figcaption>stochastic gradient descent<\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Stochastic Gradient Descent Advantages<\/h4>\n\n\n\n<ol class=\"wp-block-list\"><li>It is computationally fast as only one sample is processed at a time.<\/li><li>For larger datasets, it can converge faster as it causes updates to the parameters more frequently<\/li><li>Due to frequent updates, the steps taken towards the minima of the loss function have oscillations which can help to get out of local minimums of the loss function<\/li><\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Stochastic Gradient Descent Disadvantages<\/h4>\n\n\n\n<ol class=\"wp-block-list\"><li>Due to frequent updates, the steps taken towards the minima are very noisy. This can often lead the gradient descent into other directions.<\/li><li>It loses the advantage of vectorized operations as it deals with only a single example at a time<\/li><li>Frequent updates are computationally expensive due to using all resources for processing one training sample at a time<\/li><\/ol>\n\n\n\n<h3 class=\"has-medium-font-size wp-block-heading\">Batch Gradient Descent<\/h3>\n\n\n\n<p>The concept of carrying out batch gradient descent is the same as stochastic gradient descent. The difference is that instead of updating the parameters after using every training point, the parameters are instead updated only once i.e. after loss for all the training points is calculated.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Algorithm for batch gradient descent<\/h4>\n\n\n\n<p>Let h<sub>\u03b8<\/sub>(x) be the hypothesis for linear regression. Then, the cost function is given by:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/4-4.png\" alt=\"Batch gradient descent\" class=\"wp-image-16297 lazyload\" width=\"508\" height=\"176\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/4-4.png 404w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/4-4-300x104.png 300w\" data-sizes=\"(max-width: 508px) 100vw, 508px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 508px; --smush-placeholder-aspect-ratio: 508\/176;\" \/><figcaption>Batch gradient descent<\/figcaption><\/figure>\n\n\n\n<p>Let \u03a3 represents the sum of all training examples from i=1 to m. Where x<sub>j<\/sub>(i)&nbsp;represents the jth&nbsp;feature of the ith&nbsp;training example. If m is large it will take a long time. So, Batch gradient descent is not recommended for long datasets.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Batch Gradient Descent Advantages<\/h4>\n\n\n\n<ol class=\"wp-block-list\"><li>It can benefit from vectorization which increases the speed of processing all training samples together<\/li><li>It produces a more stable gradient descent convergence and stable error gradient than stochastic gradient descent<\/li><li>It is computationally efficient as all computer resources are not being used to process a single sample<\/li><\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Batch Gradient Descent Disadvantages<\/h4>\n\n\n\n<ol class=\"wp-block-list\"><li>Depending on computer resources it can take too long for processing all the training samples as a batch<\/li><li>The entire training set can be too large to process in the memory due to which additional memory might be needed<\/li><\/ol>\n\n\n\n<p>Thanks for reading<\/p>\n\n\n\n<div style=\"text-align:center\" class=\"wp-block-atomic-blocks-ab-button ab-block-button\"><a href=\"https:\/\/copyassignment.com\/top-100-python-projects-with-source-code\/\" class=\"ab-button ab-button-shape-rounded ab-button-size-medium\" style=\"color:#ffffff;background-color:#3373dc\">Best 100+ Python Projects with source code<\/a><\/div>\n\n\n\n<p>I hope you enjoyed learning and got what you need.<\/p>\n\n\n\n<p>Comment if you have any queries or if you found something wrong in this article.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p style=\"font-size:28px\"><strong>Also Read:<\/strong><\/p>\n\n\n<ul class=\"wp-block-latest-posts__list wp-block-latest-posts\"><li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/flower-classification-using-cnn\/\">Flower classification using CNN<\/a><div class=\"wp-block-latest-posts__post-excerpt\">You know how machine learning is developing and emerging daily to provide efficient and hurdle-free solutions to day-to-day problems. It covers all possible solutions, from building recommendation systems to predicting something. In this article, we are discussing one such machine-learning classification application i.e. Flower classification using CNN. We all come across a number of flowers&#8230;<\/div><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/music-recommendation-system-in-machine-learning\/\">Music Recommendation System in Machine Learning<\/a><div class=\"wp-block-latest-posts__post-excerpt\">In this article, we are discussing a music recommendation system using machine learning techniques briefly. Introduction You love listening to music right? Imagine hearing your favorite song on any online music platform let&#8217;s say Spotify. Suppose that the song&#8217;s finished, what now? Yes, the next song gets played automatically. Have you ever imagined, how so?&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/top-15-python-libraries-for-data-science-in-2022\/\" aria-label=\"Top 15 Python Libraries For Data Science in 2022\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Top-15-Python-Libraries-For-Data-Science-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Top 15 Python Libraries For Data Science\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Top-15-Python-Libraries-For-Data-Science-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Top-15-Python-Libraries-For-Data-Science-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Top-15-Python-Libraries-For-Data-Science-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/top-15-python-libraries-for-data-science-in-2022\/\">Top 15 Python Libraries For Data Science in 2022<\/a><div class=\"wp-block-latest-posts__post-excerpt\">Introduction In this informative article, we look at the most important Python Libraries For Data Science and explain how their distinct features may help you develop your data science knowledge. Python has a rich data science library environment. It&#8217;s almost impossible to cover everything in a single article. As a consequence, we&#8217;ve compiled a list&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/top-15-python-libraries-for-machine-learning-in-2022\/\" aria-label=\"Top 15 Python Libraries For Machine Learning\u00a0in 2022\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Top-15-Python-Libraries-For-Machine-Learning-in-2022-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Top 15 Python Libraries For Machine Learning in 2022\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Top-15-Python-Libraries-For-Machine-Learning-in-2022-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Top-15-Python-Libraries-For-Machine-Learning-in-2022-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Top-15-Python-Libraries-For-Machine-Learning-in-2022-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/top-15-python-libraries-for-machine-learning-in-2022\/\">Top 15 Python Libraries For Machine Learning\u00a0in 2022<\/a><div class=\"wp-block-latest-posts__post-excerpt\">Introduction&nbsp; In today&#8217;s digital environment, artificial intelligence (AI) and machine learning (ML) are getting more and more popular. Because of their growing popularity, machine learning technologies and algorithms should be mastered by IT workers. Specifically, Python machine learning libraries are what we are investigating today. We give individuals a head start on the new year&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/machine-learning-in-visual-studio-code\/\" aria-label=\"Setup and Run Machine Learning in Visual Studio Code\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Setup-and-Run-Machine-Learning-in-Visual-Studio-Code-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Setup and Run Machine Learning in Visual Studio Code\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Setup-and-Run-Machine-Learning-in-Visual-Studio-Code-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Setup-and-Run-Machine-Learning-in-Visual-Studio-Code-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Setup-and-Run-Machine-Learning-in-Visual-Studio-Code-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/machine-learning-in-visual-studio-code\/\">Setup and Run Machine Learning in Visual Studio Code<\/a><div class=\"wp-block-latest-posts__post-excerpt\">In this article, we are going to discuss how we can really run our machine learning in Visual Studio Code. Generally, most machine learning projects are developed as &#8216;.ipynb&#8217; in Jupyter notebook or Google Collaboratory. However, Visual Studio Code is powerful among programming code editors, and also possesses the facility to run ML or Data&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/diabetes-prediction-using-machine-learning\/\" aria-label=\"Diabetes prediction using Machine Learning\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Diabetes-prediction-using-Machine-Learning-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Diabetes prediction using Machine Learning\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Diabetes-prediction-using-Machine-Learning-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Diabetes-prediction-using-Machine-Learning-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/09\/Diabetes-prediction-using-Machine-Learning-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/diabetes-prediction-using-machine-learning\/\">Diabetes prediction using Machine Learning<\/a><div class=\"wp-block-latest-posts__post-excerpt\">In this article, we are going to build a project on Diabetes Prediction using Machine Learning. Machine Learning is very useful in the medical field to detect many diseases in their early stage. Diabetes prediction is one such Machine Learning model which helps to detect diabetes in humans. Also, we will see how to Deploy&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/15-deep-learning-projects-for-final-year\/\" aria-label=\"15 Deep Learning Projects for Final year\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/15-Deep-Learning-Projects-for-Final-year-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"15 Deep Learning Projects for Final year\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/15-Deep-Learning-Projects-for-Final-year-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/15-Deep-Learning-Projects-for-Final-year-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/15-Deep-Learning-Projects-for-Final-year-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/15-deep-learning-projects-for-final-year\/\">15 Deep Learning Projects for Final year<\/a><div class=\"wp-block-latest-posts__post-excerpt\">Introduction In this tutorial, we are going to learn about Deep Learning Projects for Final year students. It contains all the beginner, intermediate and advanced level project ideas as well as an understanding of what is deep learning and the applications of deep learning. What is Deep Learning? Deep learning is basically the subset of&#8230;<\/div><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/machine-learning-scenario-based-questions\/\">Machine Learning Scenario-Based Questions<\/a><div class=\"wp-block-latest-posts__post-excerpt\">Here, we will be talking about some popular Data Science and Machine Learning Scenario-Based Questions that must be covered while preparing for the interview. We have tried to select the best scenario-based machine learning interview questions which should help our readers in the best ways. Let&#8217;s start, Question 1: Assume that you have to achieve&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/customer-behaviour-analysis-machine-learning-and-python\/\" aria-label=\"Customer Behaviour Analysis &#8211; Machine Learning and Python\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Customer-Behaviour-Analysis-Machine-Learning-and-Python-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Customer Behaviour Analysis - Machine Learning and Python\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Customer-Behaviour-Analysis-Machine-Learning-and-Python-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Customer-Behaviour-Analysis-Machine-Learning-and-Python-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Customer-Behaviour-Analysis-Machine-Learning-and-Python-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/customer-behaviour-analysis-machine-learning-and-python\/\">Customer Behaviour Analysis &#8211; Machine Learning and Python<\/a><div class=\"wp-block-latest-posts__post-excerpt\">Introduction A company runs successfully due to its customers. Understanding the need of customers and fulfilling them through the products is the aim of the company. Most successful businesses achieved the heights by knowing the need of customers and dynamically changing their strategies and development process. Customer Behaviour Analysis is as important as a customer&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/nxnxn-matrix-in-python-3\/\" aria-label=\"NxNxN Matrix in Python 3\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/NxNxN-Matrix-in-Python-3-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"NxNxN Matrix in Python 3\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/NxNxN-Matrix-in-Python-3-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/NxNxN-Matrix-in-Python-3-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/NxNxN-Matrix-in-Python-3-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/nxnxn-matrix-in-python-3\/\">NxNxN Matrix in Python 3<\/a><div class=\"wp-block-latest-posts__post-excerpt\">A 3d matrix(NxNxN) can be created in Python using lists or NumPy. Numpy provides us with an easier and more efficient way of creating and handling 3d matrices. We will look at the different operations we can provide on a 3d matrix i.e. NxNxN Matrix in Python 3 using NumPy. Create an NxNxN Matrix in&#8230;<\/div><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/3-vs-of-big-data\/\">3 V&#8217;s of Big data<\/a><div class=\"wp-block-latest-posts__post-excerpt\">In this article, we will explore the 3 V&#8217;s of Big data. Big data is one of the most trending topics in the last two decades. It is due to the massive amount of data that has been produced as well as consumed by everyone across the globe. Major evolution in the internet during the&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/naive-bayes-in-machine-learning\/\" aria-label=\"Naive Bayes in Machine Learning\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Naive-Bayes-in-Machine-Learning-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Naive Bayes in Machine Learning\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Naive-Bayes-in-Machine-Learning-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Naive-Bayes-in-Machine-Learning-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Naive-Bayes-in-Machine-Learning-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/naive-bayes-in-machine-learning\/\">Naive Bayes in Machine Learning<\/a><div class=\"wp-block-latest-posts__post-excerpt\">In the Machine Learning series, following a bunch of articles, in this article, we are going to learn about the Naive Bayes Algorithm in detail. This algorithm is simple as well as efficient in most cases. Before starting with the algorithm get a quick overview of other&nbsp;machine learning algorithms. What is Naive Bayes? Naive Bayes&#8230;<\/div><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/automate-data-mining-with-python\/\">Automate Data Mining With Python<\/a><div class=\"wp-block-latest-posts__post-excerpt\">Introduction Data mining is one of the most crucial steps in Data Science. To drive meaningful insights from data to take business decisions, it is very important to mine the data. Deleting or ignoring unnecessary and unavailable parts of data and focusing on the correct and right data is beneficial, and more if required in&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/support-vector-machine-svm-in-machine-learning\/\" aria-label=\"Support Vector Machine(SVM) in Machine Learning\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Support-Vector-MachineSVM-in-Machine-Learning-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Support Vector Machine(SVM) in Machine Learning\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Support-Vector-MachineSVM-in-Machine-Learning-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Support-Vector-MachineSVM-in-Machine-Learning-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Support-Vector-MachineSVM-in-Machine-Learning-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/support-vector-machine-svm-in-machine-learning\/\">Support Vector Machine(SVM) in Machine Learning<\/a><div class=\"wp-block-latest-posts__post-excerpt\">Introduction to Support vector machine In the Machine Learning series, following a bunch of articles, in this article, we are going to learn about Support Vector Machine Algorithm in detail. In most of the tasks machine learning models handle like classifying images, handling large amounts of data, and predicting future values based on current values,&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/convert-ipynb-to-python\/\" aria-label=\"Convert ipynb to Python\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Convert-ipynb-to-Python-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Convert ipynb to Python\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Convert-ipynb-to-Python-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Convert-ipynb-to-Python-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/08\/Convert-ipynb-to-Python-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/convert-ipynb-to-python\/\">Convert ipynb to Python<\/a><div class=\"wp-block-latest-posts__post-excerpt\">This article is all about learning how to Convert ipynb to Python. There is no doubt that Python is the most widely used and acceptable language and the number of different ways one can code in Python is uncountable. One of the most preferred ways is by coding in Jupyter Notebooks. This allows a user&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/data-science-projects-for-final-year\/\" aria-label=\"Data Science Projects for Final Year\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/07\/Data-Science-Projects-for-Final-Year-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Data Science Projects for Final Year\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/07\/Data-Science-Projects-for-Final-Year-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/07\/Data-Science-Projects-for-Final-Year-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/07\/Data-Science-Projects-for-Final-Year-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/data-science-projects-for-final-year\/\">Data Science Projects for Final Year<\/a><div class=\"wp-block-latest-posts__post-excerpt\">Do you plan to complete your data science course this year? If so, one of the criteria for receiving your degree can be a data analytics project. Picking the best Data Science Projects for Final Year might be difficult. Many of them have a high learning curve, which might not be the best option if&#8230;<\/div><\/li>\n<li><div class=\"wp-block-latest-posts__featured-image alignleft\"><a href=\"https:\/\/copyassignment.com\/multiclass-classification-in-machine-learning\/\" aria-label=\"Multiclass Classification in Machine Learning\"><img decoding=\"async\" width=\"150\" height=\"150\" data-src=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/07\/Multiclass-Classification-in-Machine-Learning-150x150.jpg\" class=\"attachment-thumbnail size-thumbnail wp-post-image lazyload\" alt=\"Multiclass Classification in Machine Learning\" data-srcset=\"https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/07\/Multiclass-Classification-in-Machine-Learning-150x150.jpg 150w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/07\/Multiclass-Classification-in-Machine-Learning-600x600.jpg 600w, https:\/\/copyassignment.com\/wp-content\/uploads\/2022\/07\/Multiclass-Classification-in-Machine-Learning-100x100.jpg 100w\" data-sizes=\"(max-width: 150px) 100vw, 150px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 150px; --smush-placeholder-aspect-ratio: 150\/150;\" \/><\/a><\/div><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/copyassignment.com\/multiclass-classification-in-machine-learning\/\">Multiclass Classification in Machine Learning<\/a><div class=\"wp-block-latest-posts__post-excerpt\">Introduction The fact that you\u2019re reading this article is evidence of the fact that you\u2019ve finally realised that classification problems in real life are rarely limited to a binary choice of \u2018yes\u2019 and \u2018no\u2019, or \u2018this\u2019 and \u2018that\u2019. If the number of classes that the tuples can be classified into exceeds two, the classification is&#8230;<\/div><\/li>\n<\/ul>\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>In the last tutorial, we learned about our first ML algorithm called Linear Regression. We did it using an approach called Ordinary Least Squares, but&#8230;<\/p>\n","protected":false},"author":62,"featured_media":12790,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,1137],"tags":[1204,1120,1750],"class_list":["post-6744","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-allcategorites","category-machine-learning","tag-gradient-descent-another-approach-to-linear-regression","tag-machine-learning","tag-machine-learning-algorithms","wpcat-22-id","wpcat-1137-id"],"_links":{"self":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/posts\/6744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/comments?post=6744"}],"version-history":[{"count":0,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/posts\/6744\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/media\/12790"}],"wp:attachment":[{"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/media?parent=6744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/categories?post=6744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/copyassignment.com\/wp-json\/wp\/v2\/tags?post=6744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}