<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on Gabriel Berardi</title><link>http://www.gabriel-berardi.com/tags/python/</link><description>Recent content in Python on Gabriel Berardi</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 01 Nov 2020 00:00:00 +0000</lastBuildDate><atom:link href="http://www.gabriel-berardi.com/tags/python/index.xml" rel="self" type="application/rss+xml"/><item><title>Where to Eat in Munich?</title><link>http://www.gabriel-berardi.com/blog/data/2020-11-01-where-to-eat-in-munich/</link><pubDate>Sun, 01 Nov 2020 00:00:00 +0000</pubDate><guid>http://www.gabriel-berardi.com/blog/data/2020-11-01-where-to-eat-in-munich/</guid><description>&lt;p&gt;I recently moved to a new city - Munich! I live in a very calm area, but soon realized that the neighborhood is not really the best when it comes to eating outside. So, I decided to try to analyze review data from the web to find out which area is most compelling for me and other foodies. I scraped online reviews, cleaned the data and then visualized it on a map, showing the average rating of restaurants in different areas in Munich.&lt;/p&gt;</description></item><item><title>Detect Forged Banknotes with a Logistic Regression</title><link>http://www.gabriel-berardi.com/blog/data/2020-09-01-detect-forged-banknotes-with-a-logistic-regression/</link><pubDate>Tue, 01 Sep 2020 00:00:00 +0000</pubDate><guid>http://www.gabriel-berardi.com/blog/data/2020-09-01-detect-forged-banknotes-with-a-logistic-regression/</guid><description>&lt;p&gt;Counterfeit money is a serious problem for both individuals and businesses. Counterfeiters constantly find new ways and techniques to produce fake banknotes, that are essentially
indistinguishable from real money. At least for the human eye!&lt;/p&gt;
&lt;p&gt;Identifying forged banknotes is a typical example of a binary classification task in Machine Learning. If we have enough data of both real and forged banknotes, we can use this data to
train a model that can classify new banknotes as either real or fake.&lt;/p&gt;</description></item><item><title>Simple Facial Recognition with OpenCV</title><link>http://www.gabriel-berardi.com/blog/data/2020-08-01-simple-facial-recognition-with-opencv/</link><pubDate>Sat, 01 Aug 2020 00:00:00 +0000</pubDate><guid>http://www.gabriel-berardi.com/blog/data/2020-08-01-simple-facial-recognition-with-opencv/</guid><description>&lt;p&gt;Have you ever seen some cool applications of computer vision tools, like this the one below?&lt;/p&gt;
&lt;p&gt;Perhaps your phone&amp;rsquo;s camera can autofocus on faces, or maybe you have uploaded a photo on a social media platform and it automatically recognized the person on the image?&lt;/p&gt;
&lt;p&gt;These are facial recognition applications and they all rely on Machine Learning. In this post, we are going to use a very easy package called OpenCV to build our
own facial recognition program!&lt;/p&gt;</description></item><item><title>Linear and Logistic Regression</title><link>http://www.gabriel-berardi.com/blog/data/2020-07-01-linear-and-logistic-regression/</link><pubDate>Wed, 01 Jul 2020 00:00:00 +0000</pubDate><guid>http://www.gabriel-berardi.com/blog/data/2020-07-01-linear-and-logistic-regression/</guid><description>&lt;p&gt;Linear and Logistic regression are among the most elementary algorithms for supervised learning. Supervised Learning describes the situation where we deal with labeled data, which means that we have labeled inputs and a target variable.&lt;/p&gt;
&lt;p&gt;Despite the fact that both have the word &amp;ldquo;regression&amp;rdquo; in their name, only one of them is typically being used for solving regression problems!&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s see how they work!&lt;/p&gt;
&lt;h2 id="linear-regression"&gt;Linear Regression&lt;/h2&gt;
&lt;p&gt;Linear regression is possibly the easiest, most intuitive way of making a quantitative prediction. The relationship between an independent and a dependent variable is assumed to be linear, meaning that the dependent variable can be predicted using a linear function of the independent variable. For example:&lt;/p&gt;</description></item><item><title>How to Create a Racing Bar Chart with Python</title><link>http://www.gabriel-berardi.com/blog/data/2020-05-01-racing-bar-chart/</link><pubDate>Fri, 01 May 2020 00:00:00 +0000</pubDate><guid>http://www.gabriel-berardi.com/blog/data/2020-05-01-racing-bar-chart/</guid><description>&lt;p&gt;After reading &lt;a href="https://towardsdatascience.com/bar-chart-race-in-python-with-matplotlib-8e687a5c8a41"&gt;this article&lt;/a&gt; from Pratap Vardhan with great interest, I
wanted to build my own version of a Bar Chart Race that is smoother and a bit more beautiful. The biggest improvement is the interpolation (or augmentation) of
the available data points in order to make the animation smoother.&lt;/p&gt;
&lt;p&gt;Here is the Bar Chart Race we are going to build in this article:&lt;/p&gt;
&lt;p&gt;








&lt;a href="images/racing-bar-chart.gif" data-fancybox="post-images" data-caption="racing bar chart we are going to create in this post"&gt;
 &lt;img src="images/racing-bar-chart.gif" alt="racing bar chart we are going to create in this post" /&gt;
&lt;/a&gt;
&lt;/p&gt;</description></item><item><title>Scrape a Book Shop with BeautifulSoup</title><link>http://www.gabriel-berardi.com/blog/data/2020-03-01-scrape-bookshop-with-beautifulsoup/</link><pubDate>Sun, 01 Mar 2020 00:00:00 +0000</pubDate><guid>http://www.gabriel-berardi.com/blog/data/2020-03-01-scrape-bookshop-with-beautifulsoup/</guid><description>&lt;p&gt;Web Scraping is the automated process of extracting data from websites. This is commonly done by retrieving the HTML code of a website through a request and then extracting the information hidden in the HTML code programmatically. This is especially useful when there is no convenient API available to you!&lt;/p&gt;
&lt;p&gt;There has been a lot of discussion going on about the legality and ethics of Web Scraping, which I do not want to get into in this article. You can find a lot of information on this online.&lt;/p&gt;</description></item><item><title>k-Means Clustering</title><link>http://www.gabriel-berardi.com/blog/data/2020-01-01-k-means-clustering/</link><pubDate>Wed, 01 Jan 2020 00:00:00 +0000</pubDate><guid>http://www.gabriel-berardi.com/blog/data/2020-01-01-k-means-clustering/</guid><description>&lt;p&gt;The k-means algorithm is used to divide unlabeled data into categories or classes, in order to draw useful conclusions from the resulting clusters.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s take a look at an imaginary dataset of n = 18 observations of different coffee brands. Note that we would never actually use the k-means algorithm on such a small dataset.&lt;/p&gt;
&lt;p&gt;We plot the price of the coffee vs. the rating obtained by customers:&lt;/p&gt;
&lt;p&gt;








&lt;a href="images/coffee-price-vs-rating-scatterplot.png" data-fancybox="post-images" data-caption="scatter plot of coffee price vs customer rating"&gt;
 &lt;img src="images/coffee-price-vs-rating-scatterplot.png" alt="scatter plot of coffee price vs customer rating" /&gt;
&lt;/a&gt;
&lt;/p&gt;</description></item></channel></rss>