<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rishav Saha</title>
    <description>The latest articles on DEV Community by Rishav Saha (@rishav0907).</description>
    <link>https://dev.to/rishav0907</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F479436%2F131a7b70-fc32-4f78-9759-24b2402676f1.jpg</url>
      <title>DEV Community: Rishav Saha</title>
      <link>https://dev.to/rishav0907</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rishav0907"/>
    <language>en</language>
    <item>
      <title>Memory Management in OS Part-1| Abstract View of Memory, Memory Addressing, Linking and Loading|…</title>
      <dc:creator>Rishav Saha</dc:creator>
      <pubDate>Wed, 16 Nov 2022 11:14:33 +0000</pubDate>
      <link>https://dev.to/rishav0907/memory-management-in-os-part-1-abstract-view-of-memory-memory-addressing-linking-and-loading-16oc</link>
      <guid>https://dev.to/rishav0907/memory-management-in-os-part-1-abstract-view-of-memory-memory-addressing-linking-and-loading-16oc</guid>
      <description>&lt;h3&gt;
  
  
  Memory Management in OS Part-1| Abstract View of Memory, Memory Addressing, Linking and Loading| CS-101
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YOrHZpeO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A9TWA4OzP4FlxVl96" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YOrHZpeO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/0%2A9TWA4OzP4FlxVl96" alt="" width="880" height="660"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Photo by Gabriel Heinzer on Unsplash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hola! CS-101 will be a new series of blogs where I will try to cover the core concepts of Computer Science from Operating Systems and databases to the theory of computation and computer networks and probably a lot more. So let’s get started-&lt;/p&gt;

&lt;p&gt;Memory Management in Operating Systems refers to the working of RAM along with the CPU and how all the processes are allocated and deallocated. In general, there are two kinds of memory management practices:&lt;/p&gt;

&lt;p&gt;a) Contiguous Memory Management-&lt;/p&gt;

&lt;p&gt;b) Non-Contiguous Memory Management-&lt;/p&gt;

&lt;p&gt;But before learning how these two kinds of memory management techniques are used, we will have to get some of our basic concepts regarding the working of the memory cleared&lt;/p&gt;

&lt;p&gt;In this blog, we will try to get an understanding of how the memory looks logically, how addressing works, and finally how linking and loading are done&lt;/p&gt;
&lt;h4&gt;
  
  
  1. Abstract View of Memory
&lt;/h4&gt;

&lt;p&gt;Every one of us might have encountered something called a 32-bit CPU or a 64-bit CPU. Not only CPU but we may also have heard about 32 or 64-bit software. So if we have a 32-bit CPU, it means that the CPU can request and fetch 32-bits of data from the main memory in one go. Similar is the case for a 64-bit CPU&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zXD09NPv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AUsGycKC4EpzmuMgTRX4frw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zXD09NPv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AUsGycKC4EpzmuMgTRX4frw.jpeg" alt="" width="880" height="707"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;CPU is sending the address to RAM and the RAM is sending the data present at that address location&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In the case of a 32-bit CPU, the CPU will send the address to the RAM and the RAM will send the 32-bit data present at that address. Now depending upon the CPU’s architecture, whether it can fetch 32-bit or 64-bit data from the RAM, these 32-bit or 64-bit data are called words. To ease this thing, a word can be thought of as a size in bits that can be accessed by the CPU in one go. For a 32-bit RAM: 1 word=32-bit and for a 64-bit RAM: 1 word=64-bit&lt;/p&gt;
&lt;h4&gt;
  
  
  2. Memory Addressing
&lt;/h4&gt;

&lt;p&gt;Let’s try to understand the concept of addressing through various examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;eg 1:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let N=number of words in memory=16&lt;/p&gt;

&lt;p&gt;To address all these 16 words, we need 4-bits. This is because the address is in binary and 2⁴=16. So 4-bis can help us represent all those 16 words&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;eg 2:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let N=256&lt;/p&gt;

&lt;p&gt;To address all the 256 words, we need 8-bits because 2⁸=256&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;eg 3:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let total memory size =4GB and 1 word = 1 Byte&lt;/p&gt;

&lt;p&gt;As 1 word = 1 byte, the processor is an 8-bit processor (1 byte = 8 bits)&lt;/p&gt;

&lt;p&gt;So, the number of words in memory is 4GW ( because 1 word=1 byte, W here means word)&lt;/p&gt;

&lt;p&gt;4GW=4 x 2³⁰ words = 2³² words&lt;/p&gt;

&lt;p&gt;So to address 2³² words, we need 32 bits.&lt;/p&gt;
&lt;h4&gt;
  
  
  3. Loading and Linking
&lt;/h4&gt;

&lt;p&gt;After a program is compiled into Machine Language, the OS performs something called Loading and Linking. Let’s understand loading first&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;strong&gt;Loading&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;For a piece of code, there could be multiple modules present in it. By modules, we mean numerous functions could be present. For eg: in a code we could have a main() , func1() , func2() and many more and each of these are a module&lt;/p&gt;

&lt;p&gt;There are two kinds of Loading:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a) Static Loading&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the case of Static Loading, we load all modules of code into memory before runtime but there are a lot of drawbacks to Static Loading&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory Utilization in this case is very inefficient, It might happen that we are calling a module under an if condition and that condition is satisfied rarely, so its a bad utilization of memory&lt;/li&gt;
&lt;li&gt;The size of the program will become huge if we load every module before runtime&lt;/li&gt;
&lt;li&gt;We also want to perform multiprocessing but if the size of a process increases, the degree of multiprocessing will reduce&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we use Dynamic Loading&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;b) Dynamic Loading&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here we only load those modules which are currently needed, every other part of memory which s not needed is deallocated. Because of this though the speed of execution decreases but memory utilization is efficient.&lt;/p&gt;

&lt;p&gt;Now let’s focus on Linking-&lt;/p&gt;
&lt;h4&gt;
  
  
  Linking
&lt;/h4&gt;

&lt;p&gt;Suppose we have a piece of code like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main(){ f(){
  ------ ------    
  ------ ------
  ------ }
  f();
  ------
  ------
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the part where main() is calling f() when translated into machine code., the equivalent instruction is BSA ( Branch and Save return address).&lt;/p&gt;

&lt;p&gt;The BSA instruction enables us to call functions. BSA requires the address of where it has to start executing. So linking is binding the call function’s address in the call function. We have to fill the address parameter of the BSA with the address of the called function and BSA also stores the address where it has to return after the called function has executed completely.&lt;/p&gt;

&lt;p&gt;There are further two kinds of Linking techniques:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a) Static Linking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In static linking, we compile both the called function and calling function at once, and instead of creating two separate Machine Level languages, we create one Machine Level Language. Here the address parameter of BSA is filled before the runtime.&lt;/p&gt;

&lt;p&gt;Another strategy is to compile the called and calling functions separately and after both are loaded in memory, the linker will place the address of the called-in function in BSA.&lt;/p&gt;

&lt;p&gt;Static Linking requires static loading because we need all the addresses of different functions. Though static linking is very fast it has poor memory utilization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;b) Dynamic Linking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dynamic loading is the most used method nowadays&lt;/p&gt;

&lt;p&gt;During the execution of the calling function when the BSA instruction is encountered, the loader is called. The loader loads the module of the called function. The linker then places the address in the BSA.&lt;/p&gt;

&lt;p&gt;Though this method is comparatively slower than static linking but is highly efficient.&lt;/p&gt;




</description>
      <category>computers</category>
      <category>memorymanagement</category>
      <category>engineering</category>
      <category>operatingsystems</category>
    </item>
    <item>
      <title>Gradient Descent- Geometrical Interpretation</title>
      <dc:creator>Rishav Saha</dc:creator>
      <pubDate>Fri, 21 Oct 2022 20:54:13 +0000</pubDate>
      <link>https://dev.to/rishav0907/gradient-descent-geometrical-interpretation-3kgb</link>
      <guid>https://dev.to/rishav0907/gradient-descent-geometrical-interpretation-3kgb</guid>
      <description>&lt;p&gt;One of the most critical tasks in Computer Science, Machine Learning, and computation, in general, is to optimize solutions. Not only important but it was also one of the most challenging tasks until the entry of modern computers. &lt;strong&gt;Gradient Descen&lt;/strong&gt; t is one such computational technique that helps us to optimize problems and the good thing is that it’s trivial to understand and get the intuition of it :)&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-requisites
&lt;/h3&gt;

&lt;p&gt;I won't be saying that there are no prerequisites and you can learn this topic without prior knowledge this time. For you to understand the underlying mathematics of Gradient Descent you need to have a good knowledge of -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Differntiation and Integration&lt;/li&gt;
&lt;li&gt;Maxima and Minima&lt;/li&gt;
&lt;li&gt;Vector Differentiation ( Just a bit of understanding would work)&lt;/li&gt;
&lt;li&gt;Your time and interest :D&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Why do we need Gradient Descent?
&lt;/h3&gt;

&lt;p&gt;Let’s take the logistic loss expression with regularization for this example-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9EEYLfSc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ArNhk34kwnHWyzNyOVVfYTQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9EEYLfSc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ArNhk34kwnHWyzNyOVVfYTQ.jpeg" alt="" width="880" height="123"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Logistic Loss with Regularization Expression&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From the equation itself, we can say that x_i and y_i are constants because these values are already present in the dataset itself. So L here is a function of W i.e the variable to find is W. So we can rewrite the equation as-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lo8NxduF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Akhd20MMizWqRaT4axoS06Q.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lo8NxduF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Akhd20MMizWqRaT4axoS06Q.jpeg" alt="" width="880" height="113"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to calculate the maxima or minima we need to calculate the vector differentiation of L w.r.t W (because W is a vector here). For simplicity let’s the consider&lt;/p&gt;

&lt;p&gt;part 1 of the expression as :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JGUh9shw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/197/1%2A9Fb8ah8SW9kAFxdyCx-79g.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JGUh9shw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/197/1%2A9Fb8ah8SW9kAFxdyCx-79g.jpeg" alt="" width="197" height="22"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and part 2 of the expression as :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WjcsgWCu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/64/1%2AzuHg2DDZsPEvoe15otAwYw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WjcsgWCu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/64/1%2AzuHg2DDZsPEvoe15otAwYw.jpeg" alt="" width="64" height="18"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s consider the 2nd part for the moment-&lt;/p&gt;

&lt;p&gt;if W was a scalar then-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4NWZhg6F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/129/1%2A6l8tHlQJjkEXxosXX4UZ0w.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4NWZhg6F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/129/1%2A6l8tHlQJjkEXxosXX4UZ0w.jpeg" alt="" width="129" height="18"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So derivative of this will be-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K-eTabeZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/121/1%2AtZdiFhrFqrsIHPZRB7Ng3Q.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K-eTabeZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/121/1%2AtZdiFhrFqrsIHPZRB7Ng3Q.jpeg" alt="" width="121" height="43"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The vector equivalent will also be the same&lt;/p&gt;

&lt;p&gt;Now let’s consider the 1st part-&lt;/p&gt;

&lt;p&gt;For this part, we will use the chain rule as usual and we will get the following&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eDtZ2HYs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/383/1%2AZ9wnWKa0Mp8kRQl9A6QsIw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eDtZ2HYs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/383/1%2AZ9wnWKa0Mp8kRQl9A6QsIw.jpeg" alt="" width="383" height="22"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So the overall equation will be —&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iURopp6M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/496/1%2A2UzOt1piTdZEscb5woR86w.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iURopp6M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/496/1%2A2UzOt1piTdZEscb5woR86w.jpeg" alt="" width="496" height="22"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These problems are extremely hard to solve, so we use computational methods like Gradient Descent.&lt;/p&gt;

&lt;h3&gt;
  
  
  Geometric Interpretation
&lt;/h3&gt;

&lt;p&gt;The gradient Descent algorithm is iterative and this is how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First, we take a random value of x* where&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;x*= argmin f(x) w.r.t x&lt;/p&gt;

&lt;p&gt;If you didn’t understand, x* by the end of the algorithm will achieve the value of argmin f(x) w.r.t x but initially, we are assigning a random value to it&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;So, x_0= initial value of x*&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As more and more iterations happen we will keep on assigning newer values:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;x_1= value of x* at iteration 1&lt;/p&gt;

&lt;p&gt;x_2= value of x* at iteration 2&lt;/p&gt;

&lt;p&gt;and so on…..&lt;/p&gt;

&lt;p&gt;At the end of the iteration, we will have x_k whose value will be very close to x*&lt;/p&gt;

&lt;p&gt;Now before showing how exactly the algorithm will work, let’s clear some basic concepts-&lt;/p&gt;

&lt;p&gt;Let us have the following function f(x) then -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yGtZFnYC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ALjJIMCcCXPeyQ0YVwxNgPg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yGtZFnYC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ALjJIMCcCXPeyQ0YVwxNgPg.jpeg" alt="" width="880" height="602"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;a) The x* marked here is what the ideal x* or the one at the end of the algorithm will look like approximately because we are calculating the value of x which will result in the min value of f(x).&lt;/p&gt;

&lt;p&gt;b) In quadrant 1, all the slopes will be positive and in quadrant 2 all slopes will be negative.&lt;/p&gt;

&lt;p&gt;c) min f(x)=- max f(x)&lt;/p&gt;

&lt;p&gt;max f(x)=- min f(x)&lt;/p&gt;

&lt;h3&gt;
  
  
  Working of the Gradient Descent Algorithm
&lt;/h3&gt;

&lt;p&gt;a) Let’s pick a point x_0 initially at random&lt;/p&gt;

&lt;p&gt;b) Now we will find x_1 such that x_1 is closer to x* and&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QPA6MZ9L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A8FWn8mmYWC6dX2E4esBmyw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QPA6MZ9L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A8FWn8mmYWC6dX2E4esBmyw.jpeg" alt="" width="880" height="966"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VWOTaccU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/176/1%2ANvi8LPAm4slnrKGQv7mVMQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VWOTaccU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/176/1%2ANvi8LPAm4slnrKGQv7mVMQ.jpeg" alt="" width="176" height="42"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Here we are calculating the derivative of f(x) at x0&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;r= step-size and let r=1&lt;/p&gt;

&lt;p&gt;Slope of f(x) at x_0 will be positive i.e [df/dx] at x_0 will be positive&lt;/p&gt;

&lt;p&gt;so x_1=x_0–(1*+ve) =&amp;gt; x1 shifted towards left of x_0 and is closer to x*&lt;/p&gt;

&lt;p&gt;c) Similarly we will calculate x2&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eguu2YTY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/175/1%2A1ITV54bi5Ift6HFdDNxZDQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eguu2YTY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/175/1%2A1ITV54bi5Ift6HFdDNxZDQ.jpeg" alt="" width="175" height="42"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can generalize the whole thing as:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8ebMe3S3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/187/1%2AT4V5ydBsQqvWmazQ4yQnLg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8ebMe3S3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/187/1%2AT4V5ydBsQqvWmazQ4yQnLg.jpeg" alt="" width="187" height="42"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will have k iterations, so we will have-&lt;/p&gt;

&lt;p&gt;x_0 , x_1 ……..x_k&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E5vxeOuq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/196/1%2AFUP6QSooVAnyZclOwRQXsQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E5vxeOuq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/196/1%2AFUP6QSooVAnyZclOwRQXsQ.jpeg" alt="" width="196" height="42"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The termination condition of the loop will be :&lt;/p&gt;

&lt;p&gt;if x_{k+1} — x_k is very small then terminate at x*=x_k&lt;/p&gt;

&lt;p&gt;Intuitively what we are doing is reducing the value of the slope at each iteration.&lt;/p&gt;

&lt;h3&gt;
  
  
  The problem with fixed r or step-size value
&lt;/h3&gt;

&lt;p&gt;Till now we were keeping the value of step-size or r constant which is a problem and we will understand why it is so-&lt;/p&gt;

&lt;p&gt;Let us have a function f(x)=x² and after some iterations, we reached x_i=0.5&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0tJSIGH6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AgAiFNr-LjPlinzvJ5sDG6Q.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0tJSIGH6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AgAiFNr-LjPlinzvJ5sDG6Q.jpeg" alt="" width="880" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if we calculate x_{i+1} we will find that it will have a value of -0.5 which is going away from x*&lt;/p&gt;

&lt;p&gt;Again x_{i+2} will have a value of +0.5. Similarly x_{i+3}=-0.5 and x_{i+4}=+0.5 and we will keep oscillating between -0.5 and +0.5. This kind of problem arises when the r value is kept fixed. So we reduce r with each iteration and keep it dynamic.&lt;/p&gt;

</description>
      <category>optimizationalgorith</category>
      <category>optimizationtechniqu</category>
      <category>artificialintelligen</category>
      <category>gradientdescent</category>
    </item>
    <item>
      <title>Hard Margin SVM: Mathematical Formulation</title>
      <dc:creator>Rishav Saha</dc:creator>
      <pubDate>Sun, 17 Apr 2022 07:25:04 +0000</pubDate>
      <link>https://dev.to/rishav0907/hard-margin-svm-mathematical-formulation-54db</link>
      <guid>https://dev.to/rishav0907/hard-margin-svm-mathematical-formulation-54db</guid>
      <description>&lt;p&gt;By this time we already know how SVM works geometrically and if you don’t then you can have a look &lt;a href="https://rishavsaha0907.medium.com/support-vector-machines-geometrical-interpretation-27adc9a65dd7"&gt;here&lt;/a&gt;. Once we understand the geometrical interpretation of SVM it is very trivial to understand the working of SVM but why the Mathematical formulation? If we have a good grasp of the internal mathematics of not only SVM but any ML model then we will be able to change the model as per our requirements. So let’s understand the mathematics of SVM in some details&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hBQZYjQx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/310/1%2APdvmDY0CezvmI2tK2rTz8A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hBQZYjQx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/310/1%2APdvmDY0CezvmI2tK2rTz8A.png" alt="" width="310" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let we have some points and they are further linearly separable. We have a hyperplane π separating thee two classes and along with it we have two more hyperplanes π+ and π- just as we talked about while understanding the geometrical interpretation. The distance d between π+ and π- is called the margin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LlERZhyr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADr5GIvpBh-na00drd6RSYA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LlERZhyr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ADr5GIvpBh-na00drd6RSYA.jpeg" alt="" width="880" height="712"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The equation of the hyperplane π :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6FkiC3r2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/350/1%2Af0y6qxpPtkGHrbsrIocziQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6FkiC3r2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/350/1%2Af0y6qxpPtkGHrbsrIocziQ.png" alt="" width="350" height="81"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;W^T =&amp;gt; transpose of W&lt;/p&gt;

&lt;p&gt;Here W is not necessarily an unit vector, it can be any vector&lt;/p&gt;

&lt;p&gt;let π+ : (W^T)X + b =+1&lt;/p&gt;

&lt;p&gt;π-: (W^T )X + b = -1&lt;/p&gt;

&lt;p&gt;Here many of us may have a question that why we took the value of +1 or -1 but actually that is not something we should be concerned about because the value can be anything and not necessarily be +1 or -1. We will look into it in details a bit later.&lt;/p&gt;

&lt;p&gt;Now we need to calculate the value of the margin or the value of d in the above fig-&lt;/p&gt;

&lt;p&gt;We know that the distance from a point to a plane or line is given by :&lt;/p&gt;

&lt;p&gt;‖(W^T)P‖ / ‖W‖&lt;/p&gt;

&lt;p&gt;So from the +ve hyperplane the distance to π will be :&lt;/p&gt;

&lt;p&gt;‖(W^T)X + b ‖ / ‖W‖ = 1 / ‖W‖&lt;/p&gt;

&lt;p&gt;This is the the distance from the +ve hyperplane to π , so we need to add the distance from the -ve hyperplane to π also&lt;/p&gt;

&lt;p&gt;So margin (d) = 2 / ‖W‖&lt;/p&gt;

&lt;p&gt;Now we need to maximize this margin and find the w* and b*( the value of w and b respectively for the maximized margin) provided the fact that all the +ve points are at one side and al the -ve points are at another side.&lt;/p&gt;

&lt;p&gt;Mathematically we can write this statement as :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AK-W8oPK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A6CtT7UUUjK4G8qFOc2BInA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AK-W8oPK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A6CtT7UUUjK4G8qFOc2BInA.jpeg" alt="" width="880" height="177"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Along with this equation we also keep in mind the constraint i.e. all +ve points will be at one side and all -ve points will be at another side.&lt;/p&gt;

&lt;p&gt;We already assumed that:&lt;/p&gt;

&lt;p&gt;π+ : (W^T)X + b =+1&lt;/p&gt;

&lt;p&gt;π-: (W^T )X + b = -1&lt;/p&gt;

&lt;p&gt;Some conclusions from the above two equations:&lt;/p&gt;

&lt;p&gt;a) If the support vector is on π+ then for those points&lt;/p&gt;

&lt;p&gt;i) y_i= +ve&lt;/p&gt;

&lt;p&gt;ii) (W^T)X + b = +ve&lt;/p&gt;

&lt;p&gt;So y_i[(W^T)X +b] = +ve&lt;/p&gt;

&lt;p&gt;b) If the support vector is on π- then for those points&lt;/p&gt;

&lt;p&gt;i) y_i= -ve&lt;/p&gt;

&lt;p&gt;ii) (W^T)X + b = -ve&lt;/p&gt;

&lt;p&gt;So y_i[(W^T)X +b] = +ve&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gsHJZm9x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ApUyXHiSz3WYdCOGzyrzWQQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gsHJZm9x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ApUyXHiSz3WYdCOGzyrzWQQ.jpeg" alt="" width="880" height="758"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the two support vectors , one on π+ and another on π- , the value of y_i[(W^T)X + b] is +ve&lt;/p&gt;

&lt;p&gt;Now if we take any other point, suppose ‘a’ . The point ‘a’ for sure has y_i=+1 because its a +ve point and as it is further above the +ve hyperplane the value of (W^T)X + b will be greater than +1. So for the point ‘a’ , the value of y_i[(W^T)X + b] will be greater than +1&lt;/p&gt;

&lt;p&gt;Again if we take any other point, suppose ‘b’ . The point ‘b’ for sure has y_i=-1 because its a -ve point and as it is further below the -ve hyperplane the value of (W^T)X + b will be lesser than -1. So for the point ‘b’ , the value of y_i[(W^T)X + b] will be greater than +1&lt;/p&gt;

&lt;p&gt;So for all points other than the support vectors , y_i[(W^T)X + b] will be greater than +1 provided the fact that the constraints we mentioned above are satisfied. The constraint optimization problem for SVM can thus be defined as-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uWhtdwS9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AAXjYMPRxd67dm_zDa2Z-Fw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uWhtdwS9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AAXjYMPRxd67dm_zDa2Z-Fw.jpeg" alt="" width="880" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the limitation with this formulation is that it works if and only if the data is linearly separable. If the data is almost linearly separable then this formulation isn’t going to work. This formulation is called the &lt;strong&gt;Hard Margin SVM&lt;/strong&gt; because we are very concerned about the position of the data points.&lt;/p&gt;

&lt;p&gt;To overcome this limitation we have another formulation called the &lt;strong&gt;Soft margin SVM&lt;/strong&gt; which works even if the data is not completely linearly separable.&lt;/p&gt;




</description>
      <category>artificialintelligen</category>
      <category>svm</category>
      <category>machinelearning</category>
      <category>supervisedlearning</category>
    </item>
    <item>
      <title>Support Vector Machines: Geometrical Interpretation</title>
      <dc:creator>Rishav Saha</dc:creator>
      <pubDate>Wed, 13 Apr 2022 06:17:16 +0000</pubDate>
      <link>https://dev.to/rishav0907/support-vector-machines-geometrical-interpretation-34j9</link>
      <guid>https://dev.to/rishav0907/support-vector-machines-geometrical-interpretation-34j9</guid>
      <description>&lt;p&gt;SVM’s are one of the most popular machine learning techniques that can be used for both classification and regression tasks. SVM’s started becoming popular in the 1990’s .In short SVM can be thought of as a supervised machine learning model which uses a hyperplane to differentiate the two classes and the objective of it is to maximize the distance between the +ve and the -ve points(for classification problems). So let’s understand the geometrical interpretation of SVM in details&lt;/p&gt;

&lt;h3&gt;
  
  
  Geometrical Interpretation:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1.Introduction
&lt;/h4&gt;

&lt;p&gt;Let we have some points and just to make it simple let the data is linearly separable&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3sMSHyBw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AL7A8lqysbrD9kkrlSYHRNw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3sMSHyBw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AL7A8lqysbrD9kkrlSYHRNw.jpeg" alt="" width="880" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can see this data is linearly separable we can have multiple hyperplanes that can separate them but here we are just considering these two hyperplanes for simplicity.&lt;/p&gt;

&lt;p&gt;Now let’s change the data a little bit for easier understanding-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--skCgFz-U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A0S65YahXUlxn7rjrccNd0A.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--skCgFz-U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A0S65YahXUlxn7rjrccNd0A.jpeg" alt="" width="880" height="871"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the question that arises is out of the two hyperplanes π1 and π2 which hyperplane should we prefer?&lt;/p&gt;

&lt;p&gt;If we choose π1 then there are many points which are close to the hyperplane (marked by a circle) . As these points are very much close to the hyperplane , if the hyperplane changes slightly then these points could get misclassified which is something we must try to avoid.&lt;/p&gt;

&lt;p&gt;Another fact that we need to understand the points which are closer to a hyperplane have a lesser probability of belonging to a class which are far from the hyperplane(not in the opposite direction)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hgtVDDSb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AOd3RznZbfjFUga6lqVjqYg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hgtVDDSb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AOd3RznZbfjFUga6lqVjqYg.jpeg" alt="" width="880" height="848"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above example the +ve point closer to π1 has a probability of 0.55 of belonging to a class while the point further away has a probability of 0.9 of belonging to the class.&lt;/p&gt;

&lt;p&gt;Thus the objective of SVM is to find a hyperplane which separates the +ve and the -ve point as far as possible. So we will choose the hyperplane π2 over π1. FYI a hyperplane that tries to separate the +ve points from the -ve points as far as possible is called a &lt;strong&gt;&lt;em&gt;margin maximizing hyperplane&lt;/em&gt;&lt;/strong&gt;. So π2 here is a margin maximizing hyperplane.&lt;/p&gt;

&lt;h4&gt;
  
  
  2.Margin Maximizing Hyperplane
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nEbrqfzi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AWqD6CbLC6Q3zgliKc3Q0qQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nEbrqfzi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AWqD6CbLC6Q3zgliKc3Q0qQ.jpeg" alt="" width="880" height="897"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we keep on drawing hyperplanes parallel to the hyperplane π then after a time we will get a plane which will intersect with the first +ve point and we call it π+ . Similarly we will get a point which will intersect with the first -ve point and we will call it π-. Both π+ and π- are parallel to each other. The points passing through π+ and π- are called support vectors(important for understanding the mathematical formulation)&lt;/p&gt;

&lt;p&gt;Let the distance between π+ and π- be d and is also called the margin.&lt;/p&gt;

&lt;p&gt;We want to maximize the value of d because a greater value of d means that the +ve and the -ve points are far away from each other and wider the gap , the better for us. So SVM basically tries to maximize the margin i.e dist(π+,π-).&lt;/p&gt;

&lt;p&gt;if margin increases =&amp;gt; misclassification decreases =&amp;gt; generalization accuracy increases(accuracy on future unseen data)&lt;/p&gt;




</description>
      <category>machinelearning</category>
      <category>supportvectormachine</category>
      <category>artificialintelligen</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Natural Language Processing with Naive Bayes</title>
      <dc:creator>Rishav Saha</dc:creator>
      <pubDate>Sun, 27 Jun 2021 20:45:37 +0000</pubDate>
      <link>https://dev.to/rishav0907/natural-language-processing-with-naive-bayes-2l6</link>
      <guid>https://dev.to/rishav0907/natural-language-processing-with-naive-bayes-2l6</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y4gzx6Ra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aa3pUBzPbaazFwQGcVfPP-Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y4gzx6Ra--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aa3pUBzPbaazFwQGcVfPP-Q.png" alt="" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many of us have heard about NLP or Natural Language Processing , and probably you are here because you want to explore this domain.So in Simple terms NLP is a technology by which computers can understand human language. But what is Naive Bayes? Naive Bayes is an algorithm that is often used for achieving Natural Language Processing. Now if you have some prior experience with Machine Learning then you may know or heard of algorithms like KNN,Logistic Regression, Linear Regression .But in this blog we will be using Naive Bayes because it is better than any other algorithm especially for text classification and if you have not heard of the above algorithms then also it doesn’t matters as we hardly require it here&lt;/p&gt;

&lt;p&gt;So I will be dividing this whole blog into two parts-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Text pre-processing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Naive Bayes&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  1.Text pre-processing
&lt;/h3&gt;

&lt;p&gt;Okay so you have made it till here? good . I know that you may not have the idea of what text pre-processing is but let’s first understand why do we need it.&lt;/p&gt;

&lt;p&gt;Let’s take a sentence — “I want to be a Computer Scientist”. Now how can we perform any mathematical operations on this piece of text without any modification because at the end our machine learning is some complex mathematical operation, the simple answer is just using piece of text and performing no further modification on it we will not be able to perform any mathematical operations. You will understand soon what do I mean by modification here.&lt;/p&gt;

&lt;p&gt;So to modify a piece of text such that we can perform some mathematical operation is to change that text into a vector. Why a vector? Because if we can somehow convert our text into a vector then we can use all Linear Algebraic Operations on our text. Sound Interesting right?&lt;/p&gt;

&lt;p&gt;There are a lot of ways by which we can convert out text into vectors-&lt;/p&gt;

&lt;p&gt;i. Bag of Words&lt;/p&gt;

&lt;p&gt;ii. Tf-Idf&lt;/p&gt;

&lt;p&gt;iii. Word2Vec&lt;/p&gt;

&lt;p&gt;iv. Average Word2Vec&lt;/p&gt;

&lt;p&gt;Here in this blog I will be discussing only the first method i.e. Bag of words&lt;/p&gt;

&lt;h3&gt;
  
  
  Bag of Words
&lt;/h3&gt;

&lt;p&gt;Bag of words is one of the widely used method to convert a given text into vector. So let’s see how bag of words actually work-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1-&lt;/strong&gt; We are given the following text data , for simplicity we will use four simple sentences.&lt;/p&gt;

&lt;p&gt;d1: “Ubuntu is a great operating system for beginners”&lt;/p&gt;

&lt;p&gt;d2: “Ubuntu is not a good operating system for beginners”&lt;/p&gt;

&lt;p&gt;d3: “Ubuntu is an amazing operating system for beginners”&lt;/p&gt;

&lt;p&gt;d4: “Ubuntu is the worst operating system for beginners”&lt;/p&gt;

&lt;p&gt;These data in the domain of machine learning are called &lt;strong&gt;documents&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2-&lt;/strong&gt; Next we will create a dictionary containing all the unique words of the four documents&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--luVzoEUQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/661/1%2AkTX8diyAZVYVP4IbHARTzA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--luVzoEUQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/661/1%2AkTX8diyAZVYVP4IbHARTzA.png" alt="" width="661" height="80"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Dictionary for BOW&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3-&lt;/strong&gt; Now we will create a vector for each of the above documents. If a document has ‘d’ words then we will create a d-dimensional vector for it. We can create this vector by using a hashmap or a dictionary like structure . This structure will also have the same length as that of the dictionary that we created above and the values of this vector will be the number of times the corresponding word in the main dictionary that has occurred in the document we are processing. Okay I know a its a bit complex! Let’s simplify the concept using an example.&lt;/p&gt;

&lt;p&gt;The vector for the first document will be -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5y-xaurp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/547/1%2AFB4bI6GEgIFs0K0PGB9tqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5y-xaurp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/547/1%2AFB4bI6GEgIFs0K0PGB9tqw.png" alt="" width="547" height="92"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Vector for document d1&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let’s understand why the resulting vectors looks so. The first value of the vector is 1 because the first word of the dictionary “Ubuntu” is present in the document d1, same goes for the indices 1,2,3,7,11,12,13,14 assuming that our index starts at 1. The fourth value of the vector is 0 because fourth word of the dictionary “an” is absent in d1 and same goes for the indices 4,5,6,8,9,10.&lt;/p&gt;

&lt;p&gt;The following piece of code shows implementation of BOW in python-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W-U-bY0E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/990/1%2AvB-UZBkTyL7CPdO5tSC82A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W-U-bY0E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/990/1%2AvB-UZBkTyL7CPdO5tSC82A.png" alt="" width="880" height="964"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Python code for BOW&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wGGvL4xH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ALhf4CZ94o3xwK_MTSABbvQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wGGvL4xH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ALhf4CZ94o3xwK_MTSABbvQ.png" alt="" width="880" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if you observe carefully , you may have a doubt that why there are 13 features when there are actually 14 unique words , the simple answer is CountVectorizer ignores one lettered words, so it has ignored the letter 'a' and so it is showing 13 features and not 14&lt;/p&gt;

&lt;p&gt;Along with this concept of BOW we have another simple concept called the binary BOW that just marks in the vector if a particular word is present or not present by using 1 or 0 respectively, it doesn’t displays the number of time a word is occurring in the vector. Now we need to process this vectors further and simplify them as more as possible and for this purpose we have some more text processing techniques —&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a) Stop-word removal&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stop words are the words which on being removed from a document doesn’t really changes the nature of that document , like if that document was a positive one like ‘d1’ in our example , on removing the stop words from that document , it will still be positive and same goes for a negative document .&lt;/p&gt;

&lt;p&gt;example: is , a , for , this etc&lt;/p&gt;

&lt;p&gt;The following piece of code prints all the stop words for the English Alphabet-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZK4vhjn2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/790/1%2AsuJU4OHbFAoQPoOyqIn95Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZK4vhjn2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/790/1%2AsuJU4OHbFAoQPoOyqIn95Q.png" alt="" width="790" height="352"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Python code for printing stop words&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2erzfFeN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AhnGDOa34O0nqZZEcwlU9Zw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2erzfFeN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AhnGDOa34O0nqZZEcwlU9Zw.png" alt="" width="880" height="220"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;stop words in English alphabet&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;b) Stemming&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For some words the actual meaning is same, like the words ‘ bore ’ &amp;amp; ‘ boring ’ , these both words actually refer to the same meaning and so should be replaced by a single word&lt;/p&gt;

&lt;p&gt;The following piece of code shows how to perform stemming in python-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V2vkGD3W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/770/1%2AQbnrzhm4K5aQEumgdrDOvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V2vkGD3W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/770/1%2AQbnrzhm4K5aQEumgdrDOvw.png" alt="" width="770" height="498"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Python code for Stemming&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xELz_UTQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/302/1%2AXae47wAayDZIXXlgWmZcFw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xELz_UTQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/302/1%2AXae47wAayDZIXXlgWmZcFw.png" alt="" width="302" height="68"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c) Lemmatization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lemmatization is basically breaking a document into individual words, or a group of two and sometimes more. If a document is divided into individual words then it is called uni-grams , if divided into a group of two words then it is called bi-grams and it goes up to n-grams.&lt;/p&gt;

&lt;p&gt;example: if we divide d1 in the following way then it is called uni-gram&lt;/p&gt;

&lt;p&gt;‘ Ubuntu ’ , ‘ is ’ , ‘a’ , ‘great’ , ‘OS’ , ‘for’ , ‘beginners’&lt;/p&gt;

&lt;p&gt;if we divide d1 like this , then it is called bi-grams&lt;/p&gt;

&lt;p&gt;‘ Ubuntu is’ , ‘ is a’ , ‘a great’ , ‘great OS’ , ‘OS for’ , ‘for beginners’&lt;/p&gt;

&lt;p&gt;So these are the basic word processing techniques that we need to perform before applying NLP algorithms&lt;/p&gt;

&lt;p&gt;Now after we have performed all the text processing we can jump into the actual Machine Learning part and understand how Naive Bayes can be used for NLP&lt;/p&gt;
&lt;h3&gt;
  
  
  Naive Bayes
&lt;/h3&gt;

&lt;p&gt;Before you go further , it is very important for you to have the concepts of probability cleared. You need to have a clear concept of — Conditional Probability , Independent events, Multiplication theorem , Bayes theorem and all the other basic concepts of probability. If you have the concepts cleared then you are ready to understand the concepts and if not I strongly suggest you to learn those concepts and come back.&lt;/p&gt;

&lt;p&gt;Okay , instead of directly showing you the formula I feel it is more important for one to understand how it is derived as the derivation tells us about the assumptions that we take while deriving the formula. So let’s start with the derivation&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8sjDz3fT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/901/1%2AmfiUFhyy_5AgtkClI4BZDw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8sjDz3fT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/901/1%2AmfiUFhyy_5AgtkClI4BZDw.jpeg" alt="" width="880" height="1250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ii4tYj8X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/858/1%2As7PUIPv0klvrLtZXruU5ig.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ii4tYj8X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/858/1%2As7PUIPv0klvrLtZXruU5ig.jpeg" alt="" width="858" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--adcifmC_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/785/1%2A7LZPW2mty_er_Z8Cj9KHww.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--adcifmC_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/785/1%2A7LZPW2mty_er_Z8Cj9KHww.jpeg" alt="" width="785" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yAFv4sKj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/955/1%2AyCTC-Zo_0Z5y9crcwl_neA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yAFv4sKj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/955/1%2AyCTC-Zo_0Z5y9crcwl_neA.jpeg" alt="" width="880" height="1179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have gone through the whole derivation , then probably you have understood that in this whole derivation , the most important part is the assumption of conditional independence and without this assumption , the whole derivation can’t be done.&lt;/p&gt;

&lt;p&gt;So the Naive Bayes formula is -&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--muKlpI9x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/431/1%2Akp5leAt7XgZvMaN7zwdiGg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--muKlpI9x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/431/1%2Akp5leAt7XgZvMaN7zwdiGg.png" alt="" width="431" height="92"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Naive Bayes Classifier&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So given any data set we just need to calculate the value of the likelihoods and probability of the classes and we can get the probability value of the class label given the data point. For whichever class label the probability value is greatest , the data point x belongs to that class&lt;/p&gt;

&lt;p&gt;Implementing Naive Bayes is extremely easy using python and can be done using the scikit learn library&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from sklearn.naive_bayes import GaussianNB
NB=GaussianNB()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can then pass the data using .fit() function and can finally predict the values using .predict()&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BONUS Content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This part is not totally about machine learning but it is an intersection of Software Engineering and Machine Learning and I feel that it will help one to appreciate how the concept of data structures and algorithms are implemented in machine learning. In scikit learn library specifically for Naive Bayes , there is a special implementation of the Naive Bayes algorithm called the “Out of Core Naive Bayes”. So this “Out of Core Naive Bayes” is used in cases where the data is huge and our RAM is comparatively much smaller , basically the whole data will not fit in RAM. Now if you are familiar with the concept of External Merge Sort , then the concept used here is almost same i.e. the whole data will be divided into a size which can fit into RAM and they will be sorted individually and will be merged finally. Now there is a pretty good chance that the actual “Out of Core Naive Bayes” isn’t actually working this way or even if it is may be it is using some more advanced version or more optimised version of External Merge Sort. I just tried to motivate you to appreciate how these algorithms may be implemented in these scenarios.&lt;/p&gt;




</description>
      <category>machinelearning</category>
      <category>bagofwords</category>
      <category>naivebayes</category>
      <category>naturallanguageproce</category>
    </item>
    <item>
      <title>What are CTF’s and why you should play CTF’s?</title>
      <dc:creator>Rishav Saha</dc:creator>
      <pubDate>Tue, 04 Aug 2020 16:35:25 +0000</pubDate>
      <link>https://dev.to/rishav0907/what-are-ctfs-and-why-you-should-play-ctfs-2850</link>
      <guid>https://dev.to/rishav0907/what-are-ctfs-and-why-you-should-play-ctfs-2850</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---45VAcTp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/768/1%2APzc5BWfqJ6ym7rH5a6xf-g.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---45VAcTp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/768/1%2APzc5BWfqJ6ym7rH5a6xf-g.jpeg" alt="" width="768" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CTF or Capture the Flags, probably you have not heard of it and there is nothing bad in it and its because CTF’s are quite underrated. So the question is what is CTF and why you should get started with CTF if you want to start your career in cyber security.&lt;/p&gt;

&lt;p&gt;This blog is going to be short and I will get straight into the point . CTF or Capture the Flags are challenges based on cyber security and ethical hacking. There are several reasons why CTF’s are helpful. One of the reason is that there are a number of domains within cyber security itself like digital forensics , cryptography , web application hacking , binary exploitation and many more and its not possible for one to master everything. CTF helps us to find the domain in which we are interested.&lt;/p&gt;

&lt;p&gt;CTF’s may be underrated but these are very helpful in increasing one’s knowledge regarding cyber security. Besides these CTF competitions are even organised internationally also like the Google CTF, DEFCON, CSAW etc.&lt;/p&gt;

&lt;p&gt;So a question may arise that will playing CTF make one a professional in cyber security ? And the answer is that it depends on your experience. Initially if you have never played any CTF you won’t be able to solve any . You need to the study the write ups that are available and understand the approach that others are using and eventually you will be creating your own write ups one day. It requires time and experience in cyber security and playing CTF is a bonus for you.&lt;/p&gt;

&lt;p&gt;Are there any prerequisites ? I would not say that no there are no prerequisites, ofcourse you need to have some basic knowledge of hacking and programming. You need to know how to perform a RCE or a SQLI or a XSS , you need to know about cryptography , about the ciphers and even about computer networking . Many are depend on automated tools like sqlmap and yes they help a lot but you need to know the backend process of all these things.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s91WbO5P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/678/1%2A5EjbLo4gTSFAcy4zrBpvzw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s91WbO5P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/678/1%2A5EjbLo4gTSFAcy4zrBpvzw.jpeg" alt="" width="678" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So the final question is from where we can play CTF? There are a lots of sites which host CTF challenges such as HackTheBox , OverTheWire , TryHackMe , Hackerone etc .&lt;/p&gt;

</description>
      <category>ctf</category>
      <category>ethicalhacking</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>How to get started with Web Development?</title>
      <dc:creator>Rishav Saha</dc:creator>
      <pubDate>Sat, 25 Jul 2020 11:30:15 +0000</pubDate>
      <link>https://dev.to/rishav0907/how-to-get-started-with-web-development-4pao</link>
      <guid>https://dev.to/rishav0907/how-to-get-started-with-web-development-4pao</guid>
      <description>&lt;p&gt;The topic of web development has evolved quiet a lot in the last 7–8 years. Earlier web development was limited to just HTML,CSS and basic Javascript. But this is not the thing now. With the evolution and development of javascript more and more libraries and frameworks of javascript are being introduced everyday.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UCOsBlez--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/304/1%2AkHXMiRJ8uNd6uiubpOMVnQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UCOsBlez--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/304/1%2AkHXMiRJ8uNd6uiubpOMVnQ.jpeg" alt="" width="304" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a person to get a job as a web developer there are many things that one need to know. Lets divide this whole thing into Front-End and Back-End. Let’s get started with the Front-End part.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Front-End Web Development&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;So before going to stuffs that one need to know as a front end developer let’s see what does a front end developer does. In simple words front end is the part of the website that you are able to visualise. For example , now you are viewing medium.com so the interface which you are able to see is the front end of the website. So a front developer simply develops the front end of a website. Now coming to what a front-end developer needs to know.&lt;/p&gt;

&lt;p&gt;As a front end developer one should obviously be familiar with HTML as it is the skeleton of a website, next comes CSS as it helps to design your site,add colours and animations.As most you know that CSS is not a programming language and as a result you cannot do things like declaring variables and other things, so here come SASS . So SASS is basically a kind of preprocessor scripting language which later on will get compiled into original CSS code.&lt;/p&gt;

&lt;p&gt;Now comes JavaScript, it is the first programming language for web development and is extremely powerful. Java Script can be used to make your site more interactive. JavaScript can be used to manipulate the HTML which is known as DOM manipulation. JavaScript is not famous because of this reason only. It is famous because of the beautiful libraries and frameworks and because of the huge community support. There are various front-end JavaScript libraries and frameworks. The famous of all of them are :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;React JS&lt;/li&gt;
&lt;li&gt;Angular Js&lt;/li&gt;
&lt;li&gt;Vue Js&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;React JS is a very famous library developed by Facebook with a very good documentation present in its &lt;a href="https://reactjs.org/"&gt;official website&lt;/a&gt; . Angular JS is also a very famous framework developed by google and is extensively in use. For further information you can visit the &lt;a href="https://angular.io/"&gt;official website&lt;/a&gt; of angular. Finally comes Vue JS ,it is said to be very lightweight and a combination of the above two.&lt;/p&gt;

&lt;p&gt;So what after JavaScript ? Here comes something called bootstrap. Bootstrap is basically a open source CSS framework. It contains JavaScript and CSS based templates which you can just copy and use in your website. Just like bootstrap there are other frameworks also like tailwind CSS and Materialize CSS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Back-End Web Development
&lt;/h3&gt;

&lt;p&gt;Just like i explained what is front-end , here also I will be explaining what actually is the back end of a site. Let’s directly go to an example, we all use Facebook right , and react on posts. Suppose you react on a post ,close Facebook and open it again. Does the reaction that you gave on the post persists there or it vanishes? obviously it persists there. This is what the back end of a site does. Here it is taking the reaction as a input and storing it in a database. Not only this but registering users , signing in , commenting are all a part of the back end.&lt;/p&gt;

&lt;p&gt;Now what shall one learn to be a back end developer? There are endless technologies for this but here I will mentioning the one which are currently having a good demand in the market.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;PHP stands for hypertext preprocessor . PHP is in development since many years and has gained a lot of popularity within these years. Many may argue that PHP is outdated , no it is not. It is a great back end language. Even web sites Facebook still uses PHP. Other technologies like wordpress are also based on PHP .&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Node JS&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Yes JavaScript can also be used for back end development and that is what makes Node JS great. It means that just by learning JavaScript you can develop front end as well as back end . Not only this Node JS is famous because of its great libraries .&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Flask&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Flask is a python library for web development . It is very lightweight and if you are in the field of Machine Learning then it will be a great choice for you because ML models are deployed using Flask.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Django&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Django is another python library for web development . Unlike flask it is generally used to deeply large scale applications. Django has a lot of built in packages which makes it a great library for web development.&lt;/p&gt;

&lt;p&gt;Now just using a back end is not going to store your data. For storing your data you need a database. There are various databases that one can and now a days non relational databases are also gaining a lot of popularity. Some of the databases that one can learn are&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;PostGreSQL&lt;/li&gt;
&lt;li&gt;MongoDB&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Last but not the least after learning these things one can also learn technologies like wordpress which makes the job very easy :).&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>backenddevelopment</category>
      <category>frontend</category>
    </item>
    <item>
      <title>My Journey towards Cyber Security</title>
      <dc:creator>Rishav Saha</dc:creator>
      <pubDate>Sun, 19 Jul 2020 05:12:00 +0000</pubDate>
      <link>https://dev.to/rishav0907/my-journey-towards-cyber-security-163j</link>
      <guid>https://dev.to/rishav0907/my-journey-towards-cyber-security-163j</guid>
      <description>&lt;p&gt;Cyber Security the name itself is something quite heavy, right? Most of the today’s youths are very much interested towards hot topics like machine learning and cyber security and so was I . Not very much interested in machine learning at that time but I was very much interested to learn about cyber security and ethical hacking.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tUHVE-9p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/275/1%2A0ZzTrCAFWxV8UTfdG2O3qA.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tUHVE-9p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/275/1%2A0ZzTrCAFWxV8UTfdG2O3qA.jpeg" alt="" width="275" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As I took biology in class 11 I thought it will be difficult for me to come in this field and also my interest in this field was not there from the very beginning. A month before my first year started I started learning programming in C. Though I was not a very good coder at that time , I was improving my skills each day. After my college started , around 1 month later there was a workshop on ethical hacking and I thought that this field is for me until I proved myself completely wrong. Lets go to a bit more detail. So starting from the beginning , around 1 week before the workshop we are asked install Kali Linux in our devices. If you don’t know it is a OS used by hackers and penetration testers ;). We were told we can use either a VM or dual boot it and I was more interested in making a dual boot instead of a VM and after several struggles also I was not even able to dual boot a OS in my laptop . I took help from many but still not able to dual boot it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Zt_uXD7W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/220/1%2A5WPjJDORVtHlWAKwA-Jbyg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zt_uXD7W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/220/1%2A5WPjJDORVtHlWAKwA-Jbyg.jpeg" alt="" width="220" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally the day before my workshop I somehow managed to accomplish my task.Now comes the day of the workshop where my real journey started. Very much excited to finally learn ethical hacking I reached the college. But as the workshop started I was loosing all of my confidence and motivation. They were teaching stuffs I have never heard of , teaching things I was hardly able to follow and at that moment I understood that hacking was not a cup of my tea. I tried to perform everything they taught at home but I was hardly able to recall them.&lt;/p&gt;

&lt;p&gt;Now what? I lost all my hopes and totally left the thought of hacking but one day out of nowhere I got a second thought of trying it. But where to start from? I looked for all kind of sources and materials. I studied day and night about it and now I was really understanding the stuffs and processes working behind the scenes. The next three months I gathered as much knowledge possible not only about hacking or cyber Security but about the technology running behind.&lt;/p&gt;

&lt;p&gt;So the question is am I a very good and professional hacker now? No not at all. But I am not a script kiddie now at least. I am a decent hacker not very much professional. Not to mention but I have even won a Capture the Flag competition hosted by our college after this :) . I don’t know where the second thought came from but its only due to this that today I am a decent cyber security student.&lt;/p&gt;

</description>
      <category>hacking</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
