<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sushilkumar Yadav on Medium]]></title>
        <description><![CDATA[Stories by Sushilkumar Yadav on Medium]]></description>
        <link>https://medium.com/@sushilkumar.yadav?source=rss-3f61b494f480------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9u85suULnnPWmzFMGV09KQ.jpeg</url>
            <title>Stories by Sushilkumar Yadav on Medium</title>
            <link>https://medium.com/@sushilkumar.yadav?source=rss-3f61b494f480------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 05:10:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sushilkumar.yadav/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Web-Scraping using Python]]></title>
            <link>https://medium.com/analytics-vidhya/web-scraping-using-python-981c75b9672e?source=rss-3f61b494f480------2</link>
            <guid isPermaLink="false">https://medium.com/p/981c75b9672e</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Sushilkumar Yadav]]></dc:creator>
            <pubDate>Tue, 07 Jul 2020 16:54:23 GMT</pubDate>
            <atom:updated>2020-07-08T14:49:05.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*iw9QNqYay_kTWlyYPvYO1w.png" /></figure><p>Ever thought of fetching some data from some website or wanted to create a structured dataset for some data science problem or for training machine learning model, etc….. if yes, then here is the solution I have got for you…</p><p>The solution is <strong>Web Scraping</strong> also known as <strong>Web Harvesting</strong> or <strong>Web Data Extraction</strong> is a tool to extract the data from the website. The data that we obtain from web scraping is in a <strong>structured</strong> data format.</p><p><strong>web scraping</strong> is — a tool for turning the unstructured <strong>data</strong> on the <strong>web</strong> into machine-readable, structured <strong>data</strong> that is ready for analysis.</p><p>Difference between <strong>web crawler</strong> and <strong>web scraper</strong>:</p><p>Web crawler: A web crawler, which we generally call a “spider,” is an artificial intelligence that browses the internet to index and searches for content by following links and exploring, like a person with too much time on their hands.</p><p>Web scraper: A web scraper is a specialized tool designed to accurately and quickly extract data from a web page. Web scrapers vary widely in design and complexity, depending on the project.</p><p>Some time on some websites, <strong>data protection</strong> is present and using the normal way you won&#39;t be able to fetch the data from the website, so I will be giving the way to solve that issue</p><p>For example, let me show you the program using which first time I got the expected response, but then the second time when I tried to extract some more data using the same code from the same website, I got the following error</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*oO52sGSWulfqZWJzuoVohw.png" /><figcaption>Data Protection issue</figcaption></figure><p>the program that I wrote for this is as follows:</p><p>import the libraries</p><pre>from urllib.request import urlopen<br>from bs4 import BeautifulSoup</pre><p>Beautifulsoup4: Beautiful Soup is a library that makes it easy to scrape information from web pages. It sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and modifying the parse tree.</p><p>urllib.request: The <a href="https://docs.python.org/3/library/urllib.request.html#module-urllib.request">urllib.request</a> module defines functions and classes which help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, cookies, and more.</p><p>To do the web scraping, open the website on which you want to perform the scraping and go the developer option, you will see the HTML code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IaVxw0XDxYgY25gCPQq5pA.png" /><figcaption>Web Page developer option</figcaption></figure><pre>url = &quot;<a href="https://www.yellowpages.com.au/search/listings?clue=Real+estate+agents&amp;locationClue=&amp;lat=&amp;lon=&amp;selectedViewMode=list">https://www.yellowpages.com.au/search/listings?clue=Real+estate+agents&amp;locationClue=&amp;lat=&amp;lon=&amp;selectedViewMode=list</a>&quot;<br>html = urlopen(url)<br>soup = BeautifulSoup(html, &#39;lxml&#39;)<br>type(soup)<br>title = soup.title<br>print(title)<br># Print out the text<br>text = soup.get_text()<br>print(soup.text)<br>all_links = soup.find_all(“a”)<br>for link in all_links:<br> if (link.get(“data-email”) == None):<br> continue<br> print(link.get(“data-email”))</pre><p>when we execute the above code, the title gets printed in the console, first time when we hit the code, we get the expected response, but the same when we try to execute second time to fetch some more data, I got the data protection message</p><p>Now suppose, you are getting this error, still, you want to fetch the data. how can you do that</p><p>So here is the python code for the same using selenium tool to fetch the email address from the website. I have used the same website as above</p><p><strong>Selenium Python</strong> bindings provide a simple API to write functional/acceptance tests using Selenium WebDriver. Through Selenium Python API you can access all functionalities of Selenium WebDriver in an intuitive way.</p><p>Selenium Python bindings provide a convenient API to access Selenium WebDrivers like Firefox, Ie, Chrome, Remote, etc. The currently supported Python versions are 2.7, 3.5, and above.</p><p>Here in this program, I had used chrome web driver</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87b4d09edb9968016b260a775d11e622/href">https://medium.com/media/87b4d09edb9968016b260a775d11e622/href</a></iframe><p>Output for this code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*as5u6O0xb4NZ3ZxHXN-2mA.png" /></figure><p>Let me show some more complex examples of fetching the data from the Flipkart website. To do this, open the Flipkart webpage, and open the developer tool for the same. check the div parameters that you want to fetch and accordingly define that in the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fiI2CInfIMomW08jGDutpg.png" /></figure><p>see the code to extract the name, price, and specs in the excel file</p><p>import the libraries</p><pre>from selenium import webdriver<br>from bs4 import BeautifulSoup<br>import pandas as pd</pre><p><strong>pandas</strong> is a fast, powerful, flexible, and easy to use open-source data analysis and manipulation tool, built on top of the <a href="https://www.python.org/">Python</a> programming language.</p><pre>driver = webdriver.Chrome(“C:\chromedriver_win32/chromedriver”)<br>products=[] #List to store name of the product<br>prices=[] #List to store price of the product<br>ratings=[] #List to store rating of the product<br>specs=[]#List to get the specs<br>driver.get(“<a href="https://www.flipkart.com/laptops/pr?sid=6bo%2Fb5g&amp;p%5B%5D=facets.offer_type%255B%255D%3DExchange%2BOffer&amp;wid=12.productCard.PMU_V2_8">https://www.flipkart.com/laptops/pr?sid=6bo%2Fb5g&amp;p%5B%5D=facets.offer_type%255B%255D%3DExchange%2BOffer&amp;wid=12.productCard.PMU_V2_8</a>&quot;)<br>content = driver.page_source<br>soup = BeautifulSoup(content)<br>for a in soup.findAll(‘a’,href=True, attrs={‘class’:’_31qSD5&#39;}):<br> name=a.find(‘div’, attrs={‘class’:’_3wU53n’})<br> price=a.find(‘div’, attrs={‘class’:’_1vC4OE _2rQ-NK’})<br> rating=a.find(‘div’, attrs={‘class’:’hGSR34&#39;})<br> spec = a.find(‘div’, attrs={‘class’:’_3ULzGw’})<br> products.append(name.text)<br> prices.append(price.text)<br> ratings.append(rating) <br> specs.append(spec.text)</pre><p>to save the data in the excel format, see the following code snippet</p><pre>df = pd.DataFrame({‘Product Name’:products,’Price’:prices,’Specification’:specs}) <br>df.to_csv(‘products1.csv’, index=False, encoding=’utf-8&#39;)</pre><p>after running the code, an excel sheet is generated containing the required information</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MESWJKT7JLhIijJYqMkE4A.png" /><figcaption>The output of the above code</figcaption></figure><p>There are many more operations that can be performed using the web scraping such as fetching the information from some table that is present on the website and then plotting them to visualize the same in the graphical representational manner</p><p>I hope this article gave you the small gist on web scraping</p><p>I have used the above websites for learning purpose only.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=981c75b9672e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/web-scraping-using-python-981c75b9672e">Web-Scraping using Python</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Covid-19 death rate prediction using Machine Learning Algorithm]]></title>
            <link>https://medium.com/analytics-vidhya/how-to-use-machine-learning-algorithms-such-as-linear-regression-on-covid19-datasets-for-prediction-56a623e2899a?source=rss-3f61b494f480------2</link>
            <guid isPermaLink="false">https://medium.com/p/56a623e2899a</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[regression]]></category>
            <dc:creator><![CDATA[Sushilkumar Yadav]]></dc:creator>
            <pubDate>Tue, 30 Jun 2020 15:19:10 GMT</pubDate>
            <atom:updated>2020-07-01T15:56:34.793Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Implementing Linear Regression algorithm on Covid19 datasets for prediction</strong></h3><p>The regression model estimates the relationships between the variables. In simple words, from the list of given input variables or features, it estimates the continuous dependent variables. Typical applications include survival prediction, weather forecasting, etc. Use regression techniques if the data range and nature of the response is real numbers. Regression activation function can be linear, quadratic, polynomial, non-linear, etc. In the training phase, the hidden parameters are optimized w.r.t. the input values presented in the training. The process that does the optimization is the gradient descent algorithm or also known as the <strong>steepest descent algorithm</strong>. The gradient descent is used to update the parameter of the model. If the learning rate would be more, it will lead to overshooting, if the learning rate is too small it would take a larger time to converge, If you are using neural networks, then you also need a Back-propagation algorithm to compute the gradient at each layer. Once the theoretical parameters/hypothesis parameters got trained (when they gave the least error during the training), then the same theory/hypothesis with the trained parameters is used with new input values to predict outcomes that will be again real values.</p><p><strong>Linear Regression</strong> is a way of predicting a response Y on the basis of a single predictor variable X.</p><h3><strong>Dataset description:</strong></h3><p>I have downloaded the dataset from kaggle.com. the dataset name is “dataset on Novel Corona Virus Disease 2019 in India”</p><p>Coronaviruses are a large family of viruses which may cause illness in animals or humans. In humans, several coronaviruses are known to cause respiratory infections ranging from the common cold to more severe diseases such as Middle East Respiratory Syndrome (MERS) and Severe Acute Respiratory Syndrome (SARS). The most recently discovered coronavirus causes coronavirus disease COVID-19 — World Health Organization</p><p>The number of new cases are increasing day by day around the world. This dataset has information from the states and union territories of India at daily level.</p><p>State-level data comes from the <a href="https://www.mohfw.gov.in/">Ministry of Health &amp; Family Welfare</a></p><p>Individual-level data comes from <a href="https://www.covid19india.org/">covid19india</a></p><p>I have used Number of COVID-19 cases in India at a daily level dataset</p><p>There are 3567 rows out of which python picked only 2524 entries because of <em>error_bad_lines=False</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*1u40mGL1YHjE12Cp59fd3A.png" /><figcaption>Dataset Description</figcaption></figure><h3><strong>Python Code</strong></h3><ol><li>Import the libraries</li></ol><pre>import pandas as pd<br>import numpy as np<br>import matplotlib.pyplot as plt #Data visualisation libraries <br>import seaborn as sns<br>from sklearn.model_selection import KFold, cross_val_score, train_test_split</pre><p>2. Read the dataset and pair plot it using seaborn. Seaborn is one of the most used Visualization tools in python</p><pre>covid_data = pd.read_csv(r’C:\Users\sushilkumar.yadav\Desktop\vmware\Personal\Spyder\Covid19datasets\covid_19_india.csv’, header=0, delim_whitespace=True, error_bad_lines=False)<br>covid_data.head()<br>covid_data.info()<br>covid_data.describe()<br>covid_data.columns<br>sns.pairplot(covid_data)</pre><p>Output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qg-uw7LnmErsi-BsdxaLNw.png" /></figure><p>3. Let’s now begin to train out the regression model! We will need to first split up our data into an X array that contains the features to train on, and a y array with the target variable, in this case, the death column.</p><pre>X = covid_data[[‘Date’, ‘Confirmed’]]<br>y = covid_data[‘Deaths’]<br>X[‘Date’] = pd.to_datetime(X[‘Date’], format=’%d-%m-%y’)</pre><p>4. Now, plotting the death rate with respect to data and all the plot with respect to the date</p><pre>plt.xticks(rotation=45)<br>print(X[‘Date’])<br>plt.plot_date(X[‘Date’], y, fmt=’b-’, xdate=True, ydate=False)<br>covid_data.plot()<br>plt.show()<br>date = X.loc[:, [‘Date’]]<br>X[‘Date2num’] = X[‘Date’].apply(lambda x: mdates.date2num(x))<br>del X[‘Date’]</pre><p>Output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kttGi4F2sTNKtZ5MzoTWBA.png" /><figcaption>Death rate plotting</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FgJ9LLCKHMyt3r5v_JaFrQ.png" /></figure><p>5. <strong>Train test split</strong></p><p>Lets split the data into a training dataset and test dataset, in our case we are using 30% data as the test data and remaining all other as the training data</p><pre>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=101)<br>date_test = date.loc[:np.floor(m*0.3)]<br>date_train = date.loc[np.floor(m*0.3)+1:]</pre><p>6. <strong>Creating and training the model</strong></p><p>Let&#39;s fit the linear regression model on the training data</p><pre>lr = LinearRegression()<br>lr.fit(X_train,y_train)</pre><p>7. Let&#39;s predict and Visualize the model</p><pre>print(‘Coefficients: \n’, lr.coef_)<br># The mean square error<br>print(“Residual sum of squares: %.2f”<br> % np.mean((lr.predict(X_test) — y_test) ** 2))<br># Explained variance score: 1 is perfect prediction<br>print(‘Variance score: %.2f’ % lr.score(X_test, y_test))<br># Plot outputs<br>plt.xticks(rotation=45)<br>plt.plot_date(date_test, y_test, fmt=’b-’, xdate=True, ydate=False, label=’Real value’)<br>plt.plot_date(date_test, lr.predict(X_test), fmt=’r-’, xdate=True, ydate=False, label=’Predicted value’)<br>plt.legend(loc=’upper center’)<br>plt.ylabel(‘No. of Deaths’)<br>plt.title(‘Covid19 Death prediction for India’)<br>plt.grid()</pre><p>Output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*VN2aKD4p1BJM3P6BYmAzUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2h_aXdPyarVy1W_045eKQ.png" /><figcaption>Real value and Predicted value</figcaption></figure><p>Hope this gives small gist on how machine learning can be implemented in solving real-life problems</p><p>Here is the complete code,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d31136d62cd305c192636a51cf8bc9cb/href">https://medium.com/media/d31136d62cd305c192636a51cf8bc9cb/href</a></iframe><p>To learn about machine learning algorithms, refer to my previous articles</p><ul><li><a href="https://medium.com/analytics-vidhya/an-overview-of-machine-learning-algorithms-4a9a881a1a4b">An Overview of Machine Learning Algorithms</a></li><li><a href="https://medium.com/analytics-vidhya/kernel-based-approaches-in-machine-learning-aaf174bdf49a">Kernel-based approaches in machine learning</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56a623e2899a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/how-to-use-machine-learning-algorithms-such-as-linear-regression-on-covid19-datasets-for-prediction-56a623e2899a">Covid-19 death rate prediction using Machine Learning Algorithm</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kernel-based approaches in machine learning]]></title>
            <link>https://medium.com/analytics-vidhya/kernel-based-approaches-in-machine-learning-aaf174bdf49a?source=rss-3f61b494f480------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaf174bdf49a</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[kernel-trick]]></category>
            <category><![CDATA[support-vector-machine]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sushilkumar Yadav]]></dc:creator>
            <pubDate>Thu, 25 Jun 2020 08:02:24 GMT</pubDate>
            <atom:updated>2020-06-26T06:03:33.533Z</atom:updated>
            <content:encoded><![CDATA[<p>Kernels are a method of using a linear classifier to solve a non-linear problem, this is done by transforming a linearly inseparable data to a linearly separable one.</p><p>Take an example, we want to classify the following classes, which are linearly inseparable, so to make both the classes linearly separable, we have to use the kernel trick. We will map the 2Dimensional non-linear observation into the 3Dimensional using some kernel trick.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*AjTkd9I_2aa5P4pvXIc-jg.png" /><figcaption>Kernel Trick</figcaption></figure><p>In machine learning, There are different types of kernel-based approaches such as Regularized Radial Basis Function (Reg RBFNN), Support Vector Machine (SVM), Kernel-fisher discriminant (KFD) analysis, Regularized Adaboost (Reg AB), etc. from all these algorithms, the widely used approach is SVM.</p><p>Let&#39;s discuss SVM in detail and try to classify the XOR logic which cannot be linearly separated using the perceptron method.</p><p>Basically the support vector machine is for binary classification using binary learning machine with some elegant properties.</p><p>The idea can be summed as</p><p><em>Given a training sample, the main goal is to construct a hyperplane as the decision boundary in such a way that the distance between the decision boundary and support vector is maximized i.e margin of separation between positive and negative example is maximized</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*nclsaiTdSP9tGJ4MtRfl7w.png" /><figcaption>Linear SVM</figcaption></figure><p>There are 2 types of SVM</p><p>1. Linear SVM</p><p>2. Non-Linear SVM</p><p><strong>Linear SVM</strong> deals with the binary classification, Consider supervised learning, with training sample(<em>xi, yi) </em>where <em>xi </em>is the input pattern and <em>yi </em>is the target output. Assume that there are 2 classes; <em>yi </em>= +1 and <em>yi </em>= -1 which are linearly separable, then the equation of the decision boundary that separates the 2 classes becomes</p><p><em>(Wx+)</em> + b =1 — — — — — — for the positive class</p><p><em>(Wx-)</em> + b =-1 — — — — — — for the negative class</p><p>W is weight and b is bias</p><p>Subtracting eq 2 from 1, We get,</p><p><em>W(x+- x-) </em>= 2= M — — — —&gt; M= optimum value of the margin of separation between the two classes, therefore equation becomes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*W-2tEmGhNnQ5KNP4DV4Gzw.png" /></figure><p><em>Above equation states that the margin of separation between binary classes is equivalent to minimizing the Euclidian norm ||W|| of the weight vector W</em></p><p><strong>two conditions</strong> need to be checked when working with <strong>linear SVM</strong></p><p><em>1.</em> <em>Wx</em> + b = 1 for positive classes and w<em>Wx</em> + b = -1 for negative classes</p><p><em>2.</em> ||<em>W</em>|| (Euclidian norm) should be minimum</p><p>There is a method called <strong>Lagrangian method (L)</strong>, which can be concluded as</p><p>For support vector, L has to maximized by changing the Lagrangian multiplier (αi)</p><p>The patterns which are far away from the boundary. For them, αi will be too small</p><p>The patterns which are near to the decision boundary, for them αi will be too large</p><p><strong><em>This technique is also known as maximum margin separator or hard margin separator</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*Xh2AMQviuSOrO5Z1XOqFlw.png" /><figcaption>Overfitting</figcaption></figure><p>When there is overfitting condition, then we cannot use Hard Margin Separator, For this, we have to use Soft margin Separator</p><p><strong>Soft margin separator</strong> is used when data with different labels are mixed up, then using soft margin separator, we have to draw the best separator line taking into account for the samples within the margin slab</p><p>The margin of separation between classes is said to be soft if a data point (<em>xi, yi)</em> violates the following condition,</p><p><em>di(Wx+</em> + b) &gt;= +1</p><p>for non-separable data points, we use a set of non-negative scalar variables, ξi into the definition of separating hyperplanes(decision boundary) as shown,</p><p><em>di(Wx+</em> + b) &gt;= 1 — ξi</p><p>ξi is called as <strong>slack variables</strong>. They measure the deviation of data points from the ideal condition of pattern separability</p><p><strong>Non-Linear SVMs</strong> are where the Kernel trick is used, in which mapping of patterns from lower dimensions to higher dimensions takes place, and to do this mapping, the kernel trick is used.</p><p>The basic morale of kernel methods is to deal with linearly inseparable data and to create nonlinear combinations of the original features to project them onto a higher dimensional space via a mapping function ϕ() where it becomes linearly separable.</p><p>Most commonly used kernel that is used for SVM is RBF kernel or Gaussian kernel</p><p>In non-linear SVM, C (user-specified positive parameters), ξi needs to be varied. More value of ξi will fit more Noise.</p><p>Let&#39;s work on linearly classify the XOR logic using the SVM kernel trick which cannot be linearly separated using the perceptron method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6187fbbf507fb836ea049e337b0292c7/href">https://medium.com/media/6187fbbf507fb836ea049e337b0292c7/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*EQk94oEilufE5BRXBxwf3w.png" /><figcaption>XOR problem- cannot be linearly separated</figcaption></figure><p>Now let&#39;s take the 400 samples, out of which 200 belongs to the class 1 and 200 belongs to class -1, see the code and output</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5785a77696c24d6df810723384e911cb/href">https://medium.com/media/5785a77696c24d6df810723384e911cb/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*PmsTRDx5RShTmqSAdqFing.png" /><figcaption>XOR plotting for large data</figcaption></figure><p>Using SVM RBF kernel, the following result we got where it could be able to draw a nonlinear decision boundary that separates the data,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aac9af2943e6dc98f1d58010b593ce36/href">https://medium.com/media/aac9af2943e6dc98f1d58010b593ce36/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*CITu4zwpeX5i9qVs95WeTQ.png" /></figure><p>To compare different types of kernel-based approaches, we studied one research paper titled ‘<strong>Kernel-based method for Hyper Spectral Image classification</strong>’ and the following are the points we noted</p><p>SVM-Poly and SVM-RBF gave the best overall performances.</p><p>When additional noises (Gaussian, Uniform and impulsive) are added are to the test set, the signal to noise ratio are varied in between 16 and 40 dB, the results obtained are as follows, when moderate noise (SNR &gt;25dB) is introduced, SVM-RBF showed high overall accuracy than KFD, however in complex situation, (SNR &lt; 25db) are simulated, KFD exhibits better accuracy than SVM-RBF, but inferior that SVM-Poly.</p><p>Comparing the results of different set of training datasets, results are recorded as follows,</p><p>Five different situations are analyzed, 0.25%, 5%, 10%, 25%, and 100% of the original training samples, and were randomly selected from the training set to train the model and to evaluate their accuracy on the total test set. These situation corresponds to a training set consisting of 12, 229, 459, 1147, 4588 samples respectively. When considering 12 samples as a training set, SVM (Both kernels) showed the better performance than the other models although the overall accuracy is very low (50%), as a rate of the training sample is increased, SVMs and Reg-AB always had a higher accuracy of 3% to 8% with respect to the KFD and Reg-RBFNN however, KFD shows poor performance in the major part of the situation and requires an expensive computation cost as samples are increased.</p><p>When a particular characteristic of hyperspectral data is considered, a sparse solution is mainly preferred because in the training process, the algorithm selects the most relevant samples for the classification and assigns them a weight in the solution. The solution given by SVMs are intrinsically sparse, but to obtain better results from SVM, at least 40% of the training samples (support vectors) are required. In the case of Reg- RBFNN, and Reg-AB, sparsity is imposed by selecting the most suitable number of weights given by the number of hidden neurons and hypotheses respectively. SVM and Reg-AB work in high dimensional feature spaces and both lead to sparse solutions in different spaces. KFD takes into account all the training samples.</p><p>From this paper, the results can be concluded are as follows,</p><p>SVMs (Both Kernels), generated excellent results in terms of computational cost. Accuracy, robustness to a common level of noise, and ensures sparsity. The drawback of SVM is that the probabilistic output cannot be generated easily.</p><p>Reg-AB generated quite comparable results as that of SVMs, improving the robustness of the Reg-RBFNN and working efficiently with the low number of labeled samples.</p><p>KFD gave good accuracies only when normal conditions are considered also it should be noted that this method is computationally inefficient.</p><p>Reg-RBFNN offered an exceptional tradeoff between accuracy and computational cost, but accuracies in all tests were lower than those provided by the other nonlinear models.</p><p>From the results, we can conclude that SVMs are better as compared to all other kernel methods because of high overall accuracies, ensuring sparsity at a much lower computational cost.</p><p>References:</p><p>[1] scikit machine learning Support Vector Machines (SVM) <a href="https://www.bogotobogo.com/python/scikit-learn/scikit_machine_learning_Support_Vector_Machines_SVM_2.php">https://www.bogotobogo.com/python/scikit-learn/scikit_machine_learning_Support_Vector_Machines_SVM_2.php</a></p><p>[2] Kernel-based methods for hyperspectral image classification <a href="https://ieeexplore.ieee.org/document/1433032">https://ieeexplore.ieee.org/document/1433032</a></p><p>to know more about machine learning algorithms, read my previous article</p><p><a href="https://medium.com/analytics-vidhya/an-overview-of-machine-learning-algorithms-4a9a881a1a4b">An Overview of Machine Learning Algorithms</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaf174bdf49a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/kernel-based-approaches-in-machine-learning-aaf174bdf49a">Kernel-based approaches in machine learning</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modifying the default error structure inWSO2 API Manager]]></title>
            <link>https://medium.com/@sushilkumar.yadav/modifying-the-default-error-structure-inwso2-api-manager-76a1e07498b?source=rss-3f61b494f480------2</link>
            <guid isPermaLink="false">https://medium.com/p/76a1e07498b</guid>
            <category><![CDATA[wso2-api-manager]]></category>
            <category><![CDATA[api-management]]></category>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[api-development]]></category>
            <dc:creator><![CDATA[Sushilkumar Yadav]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 10:32:55 GMT</pubDate>
            <atom:updated>2020-06-26T04:09:55.373Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZ0ekBFz9jaWnEgBPQEdTw.jpeg" /></figure><p>WSO2 is a very powerful open-source API management tool. It is released under Apache Software License version 2.0. There are a lot of functionalities provided by default, still, there might be some requirements that need the developer to modify some configurations and if necessary integrate the custom written java code with the generic methods and classes of wso2. WSO2 provides a web interface for the development team to deploy and manage API and for consumers to subscribe and consume the APIs.</p><p>Today in this article, I will be discussing how to change the default error structure that is provided by WSO2. To do this we have to play with the XML files. I am using WSO2 API Manager 2.6.0</p><p>our requirement was to change the error structure of 401 status code which is Unauthorised</p><p>let&#39;s take a look at default error structure and the new required error structure</p><p><strong>for invalid credentials: </strong>Default Error Structure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Prt3BiobOeE3tW9y4vL-OQ.png" /><figcaption>WSO2 default error structure for Invalid Credentials</figcaption></figure><p>Required new error structure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*co9-jzRJhFrfTZ_ewbFILg.png" /><figcaption>Required New error structure for Invalid Credentials</figcaption></figure><p><strong>for missing credentials: </strong>Default Error Structure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m7lShSyZvoVI99bNcJXThQ.png" /><figcaption>WSO2 default error structure for MissingCredentials</figcaption></figure><p>Required new error structure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GiW38EVTpZzwoj6UKCWsgw.png" /><figcaption>Required New error structure for Missing Credentials</figcaption></figure><p>The timestamp should be real-time and not the hardcoded one in the missing credentials error structure</p><p>To do this go to &lt;Product-home&gt;/repository/deployment/server/synapse-configs/default/sequences</p><p>Create an XML file in this directory:</p><p><strong>Vim invalidCredential.xml</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4767d82ec770cc084c79103731dfd8d/href">https://medium.com/media/a4767d82ec770cc084c79103731dfd8d/href</a></iframe><p><strong>Vim missingCredential.xml</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7cfba77132959e3180c116fd68cb2251/href">https://medium.com/media/7cfba77132959e3180c116fd68cb2251/href</a></iframe><p>After saving this open <strong>_auth_failure_handler_.xml</strong> and have the following configurations</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5fa3c755fe04ce423b607ca897d23edc/href">https://medium.com/media/5fa3c755fe04ce423b607ca897d23edc/href</a></iframe><p>Make sure to have the same name of the saved XML file in _auth_failure_handler_.xml</p><p>the changes should reflect even without doing the restart</p><p>That&#39;s all, you are done modifying the default error structure in WSO2</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76a1e07498b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Overview of Machine Learning Algorithms]]></title>
            <link>https://medium.com/analytics-vidhya/an-overview-of-machine-learning-algorithms-4a9a881a1a4b?source=rss-3f61b494f480------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a9a881a1a4b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Sushilkumar Yadav]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 12:55:14 GMT</pubDate>
            <atom:updated>2020-07-30T05:10:02.176Z</atom:updated>
            <content:encoded><![CDATA[<p>Let me ask you a question... What companies do after generating thousands of gigabytes of data? How product based companies make money by giving their product services for free?</p><p>Any answers….. let me come straight to the point</p><p>The ultimate goal is to collect data... Imagine if someone gets to know about your daily habits — what you do at what time, where you go, etc…, they could be able to predict your subsequent step/behavior too. as humans to learn new things, we rely on data (information), observations, etc. It’s been said that the more the person becomes old, the more he gains the experience and can take better decisions in life. When we are born, the brain is the only thing where learning begins by observing things. The exact replica of this in technology is machine learning and Artificial intelligence. Just like God has given us a brain, likewise, programmers in the technology era have given the algorithms to learn and analyze from the data (statistics) and observation. Today in this blog, I will be going through some machine learning algorithms. But before that let’s understand what exactly is machine learning.</p><p>Machine learning is the science of having computer systems to act without being explicitly programmed by the programmer. It is the branch of Artificial intelligence, that uses the ability to automatically learn and improve from the past data. The learning process begins with the observations or data and finding the pattern in data to make better decisions. The ultimate aim is to allow computers to learn automatically without human interventions. Let&#39;s take an example: in today&#39;s era, thousands of gigabytes of data are generated daily by the companies, all these data are in raw format, these data are then pre-processed using tools such as Hadoop, Map Reduce, Hive, Pig, Sqoop, Hbase,etc…. these pre-processed data are then used in different ways, such as generating analytics dashboard for the company and using machine learning to predict the results from that dashboard.</p><p>In the past decade, machine learning has given us self driving cars, pattern classification, and recognition, effective web search, application in medical science, etc…..</p><p><strong>Examples that how ML is used in medical science:</strong></p><p>1. Survival Prediction: Given a description of a patient R, predict how long R will survive — i.e. how many additional months</p><p>2. Improving cancer treatments: As there are thousands of therapies available and which therapy will be better for what patients can be predicted based on certain parameters and this will effectively help the doctors to treat the patients (supervised learning — Classification problem)</p><p>3. Finding effective querying and alerting policies</p><p>4. Intelligent diabetes management</p><p>5. Psychiatric diagnosis and treatment using patient-specific fMRI…..etc</p><p>Now, since we see that machine learning has many good points, let’s see some pain points too.</p><p>The pain point that I see is that to train deep learning models(which has more no. of hidden layers) faster, a high performing system with good GPU and CPU core must be required. The example I can give is to generate face using GAN (generative adversarial network), the minimum training time it took to us was 8 hours, since we were training on the i3 system.</p><p><strong>Lets deep dive in Machine Learning Algorithms</strong></p><ol><li><strong>Classification Algorithm:</strong></li></ol><p>Classification uses the Supervised learning model. A supervised learning algorithm takes a known set of input data and known responses to the data(output) and trains a model to generate reasonable predictions for the response to new data. Use supervised learning if both input and output are known for example predicting a dog or cat. Supervised learning is used for the patterns assigned with a target, a value or a class to predict. For instance, let&#39;s say you want to predict the revenue of a store from different inputs, then your model will be trained on historical data and use them to forecast future revenues, hence the model is supervised. The model will learn a link between the input and output. Supervised learning uses classification and regression techniques to develop predictive models.</p><p>What is the classification? In classification, we use a training set to determine the decision boundary between the classes. Once the boundary conditions are determined, the next step is to predict the target class. This whole process is termed as classification. Use classification if your data can be tagged, categorized, or separated into specific groups or classes.</p><p><strong>Common algorithms</strong> for performing classification include support vector machine (SVM), boosted and bagged decision trees, k-nearest neighbor, Naïve Bayes, discriminant analysis, logistic regression, and neural networks.</p><p>Example of classification Algorithm :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*DPg9Fy4ZoNECpa1ht7Z31Q.png" /><figcaption>Classification Algorithm</figcaption></figure><p><strong>Types of Classification Algorithm</strong>: Linear Classifiers (Logistic Regression, Naive Bayes Classifier, Linear Discriminant Analysis), Support Vector Machines (SVM), Quadratic classifiers, K nearest neighbor (KNN), Decision trees (Random Forest), Neural Network (HebbNet, Perceptron, Adaline, BP), Learning Vector Quantization</p><p>The following are the techniques to evaluate a classifier: Cross-Validation, Precision &amp; Recall, ROC Curve. Precision and recall can be calculated using the confusion matrix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*X3QujDt46zyAECp3ZSz5sg.png" /><figcaption>Confusion Matrix</figcaption></figure><p>Accuracy = TP+TN/TP+FP+FN+TN</p><p>Recall = TP/TP+FN</p><p>F1 Score = 2*(Recall * Precision) / (Recall + Precision)</p><p>We generated the following confusion matrix in one of our deep learning projects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*4d2VPjG-2E__Txs66Y2qkA.png" /><figcaption>Generated Confusion Matrix and calculated precision and recall</figcaption></figure><p><strong>2. Artificial Neural Network</strong></p><p>Artificial Neural Network has evolved from Biological Neural Network. it sees the analogy from how the human brain processes the signal.</p><p>if structurally we compare BNN with ANN, then we find the similarity as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*Z7nd9crDZBkn6JVcjl5-gw.png" /><figcaption>BNN vs ANN</figcaption></figure><p>Dendrite — Input; Soma — Neuron; Axon — Output</p><p>there are differences as well such as complexity, memory management, etc. ANN has the following <strong>architectures</strong>:</p><p>FeedForward Network, Recurrent Network, Associative Network</p><p>Artificial Neural Network is <strong>classified</strong> based on 3 parameters:</p><ol><li>According to signal flow direction: Example- MLP, LSTM</li><li>According to learning mechanism: Example- Error based learning(Back Propagation), Hebbian or associative learning (Associative Memory, Hopfield Network, etc), competitive learning(KSOFM- Kohonen self-organizing feature map, LVQ-Learning Vector Quantization)</li><li>According to structural expansion: Example- Perceptron(Adaline vs Madaline)</li></ol><p>the most popular ANN is Perceptron, Multi-layer perceptron, Backpropagation, Hopfield, Bidirectional Associative Memory(BAM), Kohonen Self-Organizing Map, LVQ, Radial Basis Function(RDF),etc.</p><p><strong>3. Clustering Algorithm</strong></p><p>The clustering algorithm also is known as the Unsupervised learning method, as in this case, we draw references from the dataset consisting of input data without labeled response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*azGM6F58EnTEK77vuoVIGA.png" /><figcaption>K Means Cluster</figcaption></figure><p>In the above example, we can see the center of each cluster in red, which is the mean of all the observations that belong to that cluster. as we see, the data that belong to a given cluster are closer to the center of that cluster, in comparison to the center of other clusters.</p><p><strong>Types of Clustering Algorithms</strong>: K-Means Clustering (Centroid based clustering), Mean shift clustering, Kohonen self-organizing maps, Density-based clustering, Distribution based clustering, Hierarchical based clustering, etc</p><p><strong>4. Reinforcement Learning</strong></p><p>Reinforcement learning is the training of machine learning models to make a sequence of decisions. in this model, artificial intelligence faces a game-like situation, where the computer applies a trial and error to come with a solution to the problem. Every action it performs, artificial intelligence gets either the rewards or penalties. Although the programmer sets the rewards policies, there is one rule that the programmer gives no hints or suggestions for how to solve the game. It&#39;s all up to the model to find an optimum way to maximize the rewards, starting from totally random trials and finishing it with sophisticated tactics and superhuman skills.</p><p>As per Yann LeCun, the head of research at Facebook, Reinforcement learning is the cherry on the great AI cake with machine learning the cake itself and deep learning the icing, without previous iterations, the cherry would top nothing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*no1YqyPp7tDxEc3i5DZDVw.png" /><figcaption>Illustration of Reinforcement Learning</figcaption></figure><p><strong>Hierarchy of Reinforcement Learning:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*EAIF0B07yHeaaZBVdkj8zw.png" /><figcaption>Reinforcement Learning Algorithms</figcaption></figure><p><strong>5. Regression Techniques</strong></p><p>This model estimates the relationships between the variables. In simple words, from the list of given input variables or features, it estimates the continuous dependent variables. Typical applications include survival prediction, weather forecasting, etc. Use regression techniques if the data range and nature of the response is real numbers. Regression activation function can be linear, quadratic, polynomial, non-linear, etc. In the training phase, the hidden parameters are optimized w.r.t. the input values presented in the training. The process that does the optimization is the gradient descent algorithm or also known as the <strong>steepest descent algorithm</strong>. The gradient descent is used to update the parameter of the model. If the learning rate would be more, it will lead to overshooting, if the learning rate is too small it would take a larger time to converge, If you are using neural networks, then you also need a Back-propagation algorithm to compute the gradient at each layer. Once the theoretical parameters/hypothesis parameters got trained (when they gave the least error during the training), then the same theory/hypothesis with the trained parameters is used with new input values to predict outcomes that will be again real values.</p><p>Example of activation function and learning rate :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*LFRysBlV7UCNQKDN4_vlVw.png" /><figcaption>Learning Rate Comparison</figcaption></figure><p><strong>types of regression algorithm</strong>: Linear Regression, Logistic Regression, Polynomial Regression, Stepwise Regression, Quantile Regression, Ridge Regression, Lasso Regression, Elastic Net Regression, Principal Component Regression (PCR), Partial Least Squares (PLS) Regression, Support Vector Regression, Ordinal Regression, Poisson Regression, Negative Binomial Regression, Quasi Poisson Regression, Cox Regression, Tobit Regression, Adaptive Neuro-Fuzzy Learning, etc</p><p><strong>6. Tree-Based Algorithms</strong></p><p>Tree-based machine learning is the most commonly used supervised learning method. Using different features from a dataset at each node, we recursively split the training sample. Make note over here is that the data that is split from the node must be effective. The split data will be effective based on the learning simple decision rules inferred from the training data. The name tree-based algorithm is because it classifies the example by sorting them down on the tree from root to leaf node with leaf note represents the classification to the example. Each node in the tree acts as a test case for some attributes which the trunks descending from the node represent the possible answers to the test case. Tree-based Algorithms are constructed using branches and nodes</p><p>The classic example of tree-based algorithms is planning of playing badminton on a particular day. First deciding the weather its sunny, cloudy or rainy and after deciding this other parameter comes which will help us decide whether we will be able to play badminton or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*Yn_xArBonRgOMGvlrvrE0Q.png" /><figcaption>illustration of Tree-Based Algorithms</figcaption></figure><p><strong>types of the decision tree</strong>: Classification Trees, Regression Trees, etc…</p><p><strong>7. Probabilistic Model</strong></p><p>This is the alternative view of machine learning algorithms that generalizes pretty much all the ML Algorithms. In this framework, we will be explicitly thinking of learning as a problem of statistical inference. The best example I can give of probabilistic modeling is <strong>Naïve Bayes models</strong>. Suppose we have a task to predict whether a movie review is positive or negative(label) based on what words (feature) appear in the review.</p><p>Thus the <strong>probability</strong> for a single data point can be written as</p><p><em>p</em>θ (y/x) = <em>p</em>θ (y| x1, x2, x3,……, xD) — — — (1)</p><p>here y is the <strong>label</strong> and x is the <strong>features</strong></p><p>for lot variables, using <strong>chain rule</strong> to the above equation,</p><p><em>p</em>θ (x1, x2, x3,……, xD, y) = <em>p</em>θ (y) <em>p</em>θ (x1 | y)<em> p</em>θ (x2|y,x1) )<em> p</em>θ (x3|y,x1, x2)</p><p>……<em> p</em>θ (xD|y, x1, x2,….., xD-1)</p><p>= <em>p</em>θ (y) ᴨ<em>p</em>θ (xD|y, x1, x2,….., xD-1)</p><p>Using naïve bayes assumption</p><p>Eq(1) becomes,</p><p><em>p</em>θ (y/x) = <em>p</em>θ (y) ᴨ<em>p</em>θ (xd|y)</p><p>…… I hope this gives small idea where probabilistic model is used.</p><p>Most of the complex algorithms are build using probabilistic modeling</p><p><strong>types of probabilistic modeling</strong>: Generative probabilistic modeling, Conditional probabilistic modeling, etc…</p><p><strong>8. Generative Models</strong></p><p>Generative modeling is an <strong>unsupervised learning</strong> type, it describes the features in data, enabling the computers to understand the real world. This algorithm processes volumes of data and makes reductions about the data into its digital essence. One of the types of generative models named <strong>Variational Autoencoder (VAE)</strong> is widely used for dimensionality reduction, another type named <strong>Generative Adversarial Network (GAN)</strong> is used to generate new photos of a particular object that looks like real objects.</p><p>Let me demonstrate, Using VAE, see the original picture and regenerated picture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*xkKGdkNekDt43eCS5tujoA.png" /><figcaption>Example of Normal and VAE Images</figcaption></figure><p>Using GAN, see the regenerated picture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*egl6RiD_ZncP3Ff0cGO-BQ.png" /><figcaption>LFW Database Samples used for GAN Database Generation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*9vGwmvHHMDIhuCDui29Qvg.png" /><figcaption>GAN Generated Database Samples</figcaption></figure><p>3 most popular types of Generative models today are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*2AiKCc0Wdb-mZObpiQ5nyg.png" /><figcaption>Widely Used Generative Model Types</figcaption></figure><p><strong>9. Deep Learning Models</strong></p><p>Deep Learning is a subfield of machine learning concerned with algorithms inspired by the structure and function of the brain called artificial neural networks. The only difference between machine learning and deep learning is that machine learning has only one hidden layer while deep learning has more than one neural network as seen in the diagram below. Basically deep l, earning is used to classify the high dimensional data. There are multiple layers in deep learning to process features, and generally, each layer extracts some piece of valuable information. It is networks that have an input layer, an output layer, and at least one hidden layer in between. Each layer performs specific types of sorting and ordering in a process that some refer to as “feature hierarchy”. One of the key uses of these sophisticated neural networks is dealing with unlabeled or unstructured data. The phrase “deep learning” is also used to describe these deep neural networks, as deep learning represents a specific form of machine learning where technologies using aspects of artificial intelligence seek to classify and order information in ways that go beyond simple input/output protocols.</p><p><strong><em>Architectures of Deep Learning</em></strong></p><p>1. Unsupervised Pretrained Networks (UPNs)</p><p>2. Convolutional Neural Networks (CNNs)</p><p>3. Recurrent Neural Network</p><p>4. Recursive Neural Network</p><p>Out of all these architectures we have implemented a Convolutional Neural Network for our face recognition model because Convolutional Neural Networks allows us to extract a wide range of features from images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*0QhGic667EO7i4xnZClRqQ.png" /><figcaption>CNN Architecture</figcaption></figure><p><strong>10. Lazy Algorithms</strong></p><p>Lazy algorithms are simple algorithms in which the generalization takes place once the query is shooted to the model. A key issue of this method is to weight the examples in relation to their distance to the query instance in such a way that the closest examples have the highest weight. KNN is one example of lazy learning algorithms.</p><p>The lazy algorithm can be illustrated from the below diagram,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*CTszxFLvDMsz_t05dY5RXg.png" /><figcaption>KNN</figcaption></figure><p><strong>11. Ensemble Methods</strong></p><p>When several machine learning algorithms are allowed to achieve better results, it is known as Ensemble Methods. Ensemble methods are meta-algorithms that combine several machine learning techniques into one predictive model in order to decrease variance, bias and improve predictions.</p><p>The best example I can give is the face recognition project that we had developed, Using different training and test sample, the following are the result that we achieved. Training samples are taken in increasing order (from less training sample to more training samples)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*CiAc4puTJLFqbBMNhsp1YA.png" /><figcaption>Accuracy using CNN and combination of VAE &amp; CNN</figcaption></figure><p>Types of Ensemble Algorithms: Adaboost, Bagging, weighted average, etc</p><p><strong>12. Apriori Algorithm</strong></p><p>Apriori algorithm is used to find the association between the data. Association rules can be thought of as an if-then (Action-Conclusion) relationship, A typical if-then rule is used to determine whether an antecedent (cause or action) infers a consequent (effect or reaction). Suppose we have a rule of the form IF A, THEN B, where A is a set defined on universe X, and B is a set defined on universe Y. Classic example I can give is supposed a customer A buys some item say book, so what is the chance that same customer A will buy the stationery item under the same transaction ID. Many fuzzy association algorithms rely on Apriori Algorithm.</p><p>Hope This article gave you the overview of machine learning Algorithms</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a9a881a1a4b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/an-overview-of-machine-learning-algorithms-4a9a881a1a4b">An Overview of Machine Learning Algorithms</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>