<?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 Pranay Rishith on Medium]]></title>
        <description><![CDATA[Stories by Pranay Rishith on Medium]]></description>
        <link>https://medium.com/@pranayrishith?source=rss-d478ca4e1ef0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*spdcZXlY-53mzl6yK8HP0w.jpeg</url>
            <title>Stories by Pranay Rishith on Medium</title>
            <link>https://medium.com/@pranayrishith?source=rss-d478ca4e1ef0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 20:20:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pranayrishith/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[Mean, Median, Mode: Essential Guide to Central Tendency Explained]]></title>
            <link>https://medium.com/@pranayrishith/mean-median-mode-essential-guide-to-central-tendency-explained-a047fbbb7a21?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a047fbbb7a21</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Tue, 31 Dec 2024 08:16:09 GMT</pubDate>
            <atom:updated>2024-12-31T08:16:09.368Z</atom:updated>
            <content:encoded><![CDATA[<h4>Master the Basics of Descriptive Statistics with Clear Explanations and Practical Examples of Mean, Median, and Mode</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_MLgcInoH_Q5FpS1" /><figcaption>Photo by <a href="https://unsplash.com/@imaginebuddy?utm_source=medium&amp;utm_medium=referral">Imagine Buddy</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Descriptive Statistics is a branch of Statistics that provides description and summarization of the data. This is used to describe the features without coming to any conclusion. One of which is Central Tendency.</p><p>Central Tendency measures the central value of the dataset. This provides a single value used to understand the distribution of the dataset. Today we will talk about Mean, Median, and Mode which are part of central tendency.</p><h3>Mean:</h3><p>This is an arithmetic average of the data in the dataset. It is sum of all the elements by the total number of elements.</p><ul><li>Mean gives a central value of the data which tells if the dataset is balanced.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DDhsXUZux_gxIlQSdxmz4Q.png" /></figure><h4><strong>Example</strong>:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ri6k52-fJuKYOB9hjbHwVw.png" /></figure><h4><strong>Characteristics</strong>:</h4><ul><li>Sensitive to outliers: If there are extreme values in the data, mean will be greatly affected.</li><li>Used for symmetrical distribution.</li></ul><h3>Median:</h3><p>The middle value of the data when the data is arranged in ascending or descending order.</p><ul><li>If there are an odd number of elements, the <strong>middle value is the median</strong>.</li><li>If there are even number of elements, the <strong>median is the average value of the middle elements.</strong></li></ul><h4><strong>Example:</strong></h4><ul><li>If X = [3,5,7], the median is 5.</li><li>If X = [3,5,7,9], the median is 6.</li></ul><h4><strong>Characteristics:</strong></h4><ul><li>Not sensitive to outliers.</li></ul><h3>Mode:</h3><p>The value that occurs most frequently in the dataset.</p><ul><li>If there is one mode — unimodal.</li><li>If there are 2 modes — bimodal.</li><li>If there are more than 2 modes — multimodal.</li></ul><h4>Example:</h4><ul><li>X = [1,2,3,4] — There are no modes.</li><li>X = [1,<strong>2,2</strong>,3,4] — there is 1 mode (unimodal).</li><li>X = [1,<strong>2,2</strong>,<strong>3,3</strong>,4] — there are 2 modes (bimodal).</li></ul><h4>Characteristics:</h4><ul><li>Robust to outliers</li><li>Best for categorical data</li></ul><p><strong>Let’s Connect!</strong><br>If you enjoyed this article, a few claps 👏 would mean the world and motivate me to create more!</p><p>Feel free to reach out and explore more of my work:</p><ul><li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/pranay16/">Pranay Rishith</a></li><li><strong>GitHub:</strong> <a href="https://github.com/pranayrishith16">pranayrishith16</a></li><li><strong>Hashnode Blog:</strong> <a href="https://beyond-blog.hashnode.dev/">Beyond Blog</a></li><li><strong>Medium: </strong><a href="https://medium.com/@pranayrishith">Pranay Blog</a></li></ul><p>Looking forward to connecting with you! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a047fbbb7a21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turning Resolutions into Realities: My 2024 Game Plan Unveiled]]></title>
            <link>https://medium.com/@pranayrishith/turning-resolutions-into-realities-my-2024-game-plan-unveiled-bb7547a00ebd?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb7547a00ebd</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Wed, 03 Jan 2024 18:33:42 GMT</pubDate>
            <atom:updated>2024-01-03T18:33:42.125Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1GXHitHHGMTpi32x" /><figcaption>Photo by <a href="https://unsplash.com/@epicantus?utm_source=medium&amp;utm_medium=referral">Daria Nepriakhina 🇺🇦</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I completed 2023 with lots of pending goals, hesitations etc. I planned different methods to make sure I achieve my goals this 2024. I will be writing about these in detail in my next blogs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb7547a00ebd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AlexNet: The Architecture that Revolutionized Computer Vision]]></title>
            <link>https://medium.datadriveninvestor.com/alexnet-the-architecture-that-revolutionized-computer-vision-8b9cf088eed5?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b9cf088eed5</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Sat, 10 Jun 2023 23:59:52 GMT</pubDate>
            <atom:updated>2023-06-11T02:09:16.980Z</atom:updated>
            <content:encoded><![CDATA[<h4>Propelling Artificial Intelligence Forward with AlexNet</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*upS22PKNTVEgx_9x" /><figcaption>Photo by <a href="https://unsplash.com/ko/@wansan_99?utm_source=medium&amp;utm_medium=referral">Wan San Yip</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Introduction</h4><p>This is the first Deep Convolutional Neural Network (CNN) that revolutionized image classification tasks. This architecture won the ImageNet challenge (ILSVRC) in 2012.</p><p>AlexNet has multiple deep layers. It consists of 60 million parameters making it one of the largest Neural Networks of that time. It was originally designed for Image classification and used to process high-resolution images. AlexNet was optimized to take advantage of GPU.</p><h4>What makes it good over LeNet?</h4><p><a href="https://medium.datadriveninvestor.com/lenet-in-computer-vision-a-comprehensive-study-510b7de8251e">Lenet in Computer Vision: A Comprehensive Study</a></p><ul><li>AlexNet is deeper than LeNet, containing 5 convolutional layers, whereas LeNet has only 2 Convolutional layers.</li><li>AlexNet uses a much better activation function —<strong> ReLU</strong>. This activation function is an upgrade on the sigmoid or tanh function.</li><li>LeNet is limited to grayscale images where whereas AlexNet uses images with color, i.e., RGB channels.</li></ul><h4>Architecture</h4><p><a href="https://pub.towardsai.net/an-introduction-to-cnns-understanding-the-basics-88986fb3c6d1">An Introduction to CNNs: Understanding the Basics</a></p><p>Let&#39;s dive in,</p><blockquote>Note: if the layer uses padding or strides, i explicitly mentioned. if i dont mention it then its default.</blockquote><p><strong>Input:</strong></p><ul><li>The input size is 227x227x3. This means it has 227 pixels of height and width and has 3 channels (<strong>RGB</strong>).</li></ul><p><strong>Layer 1 (Convolutional Layer 1):</strong></p><ul><li>Input: 227x227x3</li><li>Number of Filters: 96</li><li>Filter Size: 11x11</li><li>Strides: 4</li><li>Activation Function: ReLU</li><li>Output Size (Feature map size): 55x55x96</li></ul><p><strong>Layer 2(Max Pooling Layer 1):</strong></p><ul><li>Input size: 55x55x96</li><li>Pool size: 3x3</li><li>Stride: 2</li><li>Output Size: 27x27x96</li></ul><p><strong>Layer 3(Convolutional Layer 2):</strong></p><ul><li>Input: 27x27x96</li><li>Number of Filters: 256</li><li>Padding: 1</li><li>Filter Size: 5x5</li><li>Activation Function: ReLU</li><li>Output Size: 27x27x256</li></ul><p><strong>Layer 4(Max Pooling Layer 2):</strong></p><ul><li>Input size: 27x27x256</li><li>Pool size: 3x3</li><li>Stride: 2</li><li>Output Size: 13x13x256</li></ul><p><strong>Layer 5(Convolutional Layer 3):</strong></p><ul><li>Input: 13x13x256</li><li>Number of Filters: 384</li><li>Filter Size: 3x3</li><li>Padding: 1</li><li>Activation Function: ReLU</li><li>Output Size (Feature map size): 13x13x384</li></ul><p><strong>Layer 6(Convolutional Layer 4):</strong></p><ul><li>Input: 13x13x384</li><li>Number of Filters: 384</li><li>Filter Size: 3x3</li><li>Padding: 1</li><li>Activation Function: ReLU</li><li>Output Size (Feature map size): 13x13x384</li></ul><p><strong>Layer 7(Convolutional Layer 5):</strong></p><ul><li>Input: 13x13x384</li><li>Number of Filters: 256</li><li>Filter Size: 3x3</li><li>Padding: 1</li><li>Activation Function: ReLU</li><li>Output Size (Feature map size): 13x13x256</li></ul><p><strong>Layer 8(Max Pooling Layer 3):</strong></p><ul><li>Input size: 13x13x256</li><li>Pool size: 3x3</li><li>Stride: 2</li><li>Output Size: 6x6x256</li></ul><p><strong>Layer 9 (Flatten):</strong></p><ul><li>Input size: 6x6x256</li><li>Output size: 9216</li></ul><p><strong>Layer 10 (Fully Connected Layer 1):</strong></p><ul><li>Input size: 9216</li><li>Nodes: 4096</li><li>Activation function: ReLU</li><li>Output size: 4096</li></ul><p><strong>Layer 11 (Fully Connected Layer 2):</strong></p><ul><li>Input size: 4096</li><li>Nodes:4096</li><li>Activation function: ReLU</li><li>Output size: 4096</li></ul><p><strong>Layer 12 (Fully Connected Layer 3)</strong> <strong>[Output Layer]</strong>:</p><ul><li>Input size: 4096</li><li>Nodes: 1000</li><li>Activation function: Softmax</li><li>Output size: 1000</li></ul><h4>Code</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a1068cec00cff3b23398b0cc84c4149/href">https://medium.com/media/5a1068cec00cff3b23398b0cc84c4149/href</a></iframe><p>More advanced architectures for another article. Let us meet at the next one. If you enjoy this content, giving it some claps👏 will give me a little extra motivation.</p><p>You can reach me at:</p><p>LinkedIn: <a href="https://www.linkedin.com/in/pranay16/">https://www.linkedin.com/in/pranay16/</a></p><p>GitHub: <a href="https://github.com/pranayrishith16">https://github.com/pranayrishith16</a></p><p>Subscribe to DDIntel <a href="https://ddintel.datadriveninvestor.com/">Here</a>.</p><p>Visit our website here: <a href="https://www.datadriveninvestor.com/">https://www.datadriveninvestor.com</a></p><p>Join our network here: <a href="https://datadriveninvestor.com/collaborate">https://datadriveninvestor.com/collaborate</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b9cf088eed5" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/alexnet-the-architecture-that-revolutionized-computer-vision-8b9cf088eed5">AlexNet: The Architecture that Revolutionized Computer Vision</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding K-Nearest Neighbors: A Simple Approach to Classification and Regression]]></title>
            <link>https://pub.towardsai.net/understanding-k-nearest-neighbors-a-simple-approach-to-classification-and-regression-e4b30b37f151?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4b30b37f151</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Wed, 31 May 2023 15:51:40 GMT</pubDate>
            <atom:updated>2023-05-31T15:51:40.226Z</atom:updated>
            <content:encoded><![CDATA[<h4>Demystifying K-Nearest Neighbors: Unveiling the Power of Proximity-based Algorithm</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aXk863pWuQIuPNIu" /><figcaption>Photo by <a href="https://unsplash.com/@aviosly?utm_source=medium&amp;utm_medium=referral">Avi Waxman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>What is KNN</h3><h4>Definition</h4><p>K-Nearest Neighbors (KNN) is a supervised algorithm. The basic idea behind KNN is to find K nearest data points in the training space to the new data point and then classify the new data point based on the majority class among the k nearest data points.</p><h4>How KNN works</h4><p>KNN is a non-parametric, simple yet powerful supervised algorithm that can be used for both regression and classification tasks. This works by finding K nearest neighbors to the new, unlabeled data and making a prediction of the value or class that the new data point belongs to.</p><p><strong>Classification:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*DLe8vANFKx8zpRfjTD7ivQ.png" /><figcaption>Image by author</figcaption></figure><p>Visually observing, there are two classes, red and green. When there is a new data point (blue), and K = 5, we can see that the blue point has 3 green neighbors and 2 red neighbors; this says that the blue point is classified as the green class as the majority voting is 3. Similarly, when the K value changes, the number of neighbors increases, and the new data point is classified into its corresponding majority voting class.</p><p><strong>Regression:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*joeNdWj6_H3rhAtZ5FXy1w.png" /><figcaption>Image by author</figcaption></figure><p>KNN regressor is quite different from the classifier. As in a regressor, the dependent variable is continuous, it is scattered throughout the coordinate plane. When there is a new data point, the number of neighbors (K) is found by any of the distance metrics. After finding the neighbors, the predicted value of the new data point is the average of all the neighbor’s values combined.</p><p>For example, consider House price prediction. There is price as the dependent variable and the square feet of the house as an independent variable. Now after mapping all the data points on the Cartesian plane, when there is a new data point in square feet feature, the K neighbor’s average price value of their square feet of the house is the price of the new data point. So instead of predicting a class, the regressor uses the average of all the neighbor values.</p><h3>Understanding the KNN algorithm</h3><h4>Choosing the k value</h4><p>The K value is the main part of KNN and choosing the right k value might be troublesome. But there are some methods to find the best and optimal k value:</p><ul><li>Split the dataset as training and testing.</li><li>Choose a range of k values: select a range of k values. You can start from k = 1 and increase the value.</li><li>Train the model: Train the KNN model for each k value.</li><li>Evaluate the performance: Evaluate the performance of the model that has been trained using a range of k values. We can use precision, Accuracy, recall, F1 score, etc, to measure the performance.</li></ul><p>It is important to note that the choice of the k value depends on the dataset and the problem. A smaller k value can lead to overfitting, while a larger value of k can lead to underfitting. Therefore, it is recommended to experiment with different values of k to find the optimal value for a specific dataset.</p><h4>Types of Distance metrics</h4><p><strong>Euclidean</strong></p><ul><li>This is the most widely used distance metric in KNN, and this is the default distance metric for SKlearn library in Python. This is the straight line distance between two data points in the Euclidean space.</li><li>It is the square root of the sum of squares of data points.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*_f3Y8pSEy8_vx6SmNV9Qgw.png" /><figcaption>Image by author</figcaption></figure><ul><li>The formula is calculated as follows,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*QPzCnBbUES4mawB9UMwdNg.png" /><figcaption>Image by author</figcaption></figure><p><strong>Manhattan</strong></p><ul><li>Manhattan distance, also known as taxicab distance, is a measure of the distance between two points. It is named after a grid-like layout of Manhattan, where the distance between the two points is the shortest path a taxi could take. It is the sum of the absolute difference of the coordinates.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*NhuyLJFsLcN0iEq5D4fp8w.png" /><figcaption>Image by author</figcaption></figure><ul><li>The formula is calculated as follows,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*tOEiXo5xq5ZTQxUceSjIhA.jpeg" /><figcaption>Image by author</figcaption></figure><p><strong>Minkowski</strong></p><ul><li>This is a metric used to measure the distance between the points in multidimensional space. This metric generalizes the Manhattan and Euclidean distance metrics. This is computed as the pth root of the sum of absolute difference raised to the power of p.</li><li>We can manipulate the above formula to give us different distance metrics like:<br> — if p = 1, we get the Manhattan distance<br> — if p = 2, we get Euclidean distance</li><li>There are a few conditions that the distance metric must satisfy:<br> — Non-negativity: The distance between any two points cannot be negative.<br> — Identity: The distance between a point and itself is zero.<br> — Symmetry: The distance between two points A and B should be the same as the distance between B and A.<br> — Triangle Inequality: The distance between two points A and C should always be less than or equal to the sum of the distances between A and B, and between B and C.</li><li>The formula is as follows,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*UIVUW-gGeoJXBWIbXfA2ww.jpeg" /><figcaption>Image by author</figcaption></figure><p><strong>Cosine</strong></p><ul><li>This distance metric is used for calculating the cosine angle between the vectors. This distance metric is commonly used for computing the similarity between vectors in various applications, including text analysis. The cosine distance metric is often preferable in combination with other distance metrics to improve the performance of the model.</li><li>The formula is as follows,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*dyMV5ctsfgrUuT3NnFYngQ.jpeg" /><figcaption>Image by author</figcaption></figure><h4>Weighted vs Un-weighted KNN</h4><p><strong>Unweighted KNN</strong> is where all the data points are assigned equal weights while making the prediction of new data point. For example, if the K=5 nearest neighbors of a new data point are three belonging to class A and two belonging to class B, the new data point is classified as class A.</p><p><strong>Weighted KNN</strong> assigns weight to each of the data points. These weights are the inverse of the distance of the data point from the new data point. So the neighbors near the new data point have high weight and far ones have less weight. For example, if the K=5 nearest neighbors of a new data point are two belonging to class A and three belonging to class B, but the two neighbors belonging to class A are closer to the new data point than the three neighbors belonging to class B, the new data point is classified as class A with a higher weight.</p><h3>Advantages and Limitations of KNN</h3><h4><strong>Advantages</strong></h4><ul><li>Flexibility: KNN can be used for both regression tasks and classification tasks.</li><li>No training: KNN does not require any training, which saves computational resources.</li><li>Robust to noisy data: KNN is robust to noisy data, as it relies on majority vote of nearest neighbors. This makes it less vulnerable to outliers.</li><li>Works well with small data: KNN works well on small datasets. It does not require a large amount of data to make predictions.</li><li>Non-parametric: KNN is non-parametric algorithm, meaning it does not require to have any assumptions about the data.</li><li>Simple: KNN is a simple and easy-to-understand algorithm.</li></ul><h4><strong>Limitations</strong></h4><ul><li>Optimal K value: Choosing the right k value is important. it will impact the performance of the model. There is no universal k value and this value depends on the characteristics of the dataset features.</li><li>Imbalanced data: KNN can be biased to imbalanced data, where one class might have more examples than the other. KNN may predict the majority class for the test examples.</li><li>Curse of dimensionality: KNN can suffer from the curse of dimensionality, which occurs when the number of features are large. As the number of dimensions increases, the distance between any two points in the data tends to become larger, making it difficult to find meaningful nearest neighbors.</li></ul><h3>Applications of KNN</h3><ul><li>Classification: KNN can be used for classification like spam detection, image recognition, sentiment analysis, etc. Here KNN will classify the new data point based on the training dataset and assigns a class to it.</li><li>Regression: KNN can be used for regression like house price prediction etc. Here KNN will predict the new data point using the k nearest neighbor average value.</li><li>Text Classification: KNN can be used to classify text documents based on their content. For example, KNN is used to classify a text document based on its category, like sports, crime, etc.</li><li>Recommendation Systems: KNN can be used in recommendation systems to recommend products based on the user’s similarity to other users. For example, Netflix uses recommendation system to recommend movies that are enjoyed by users that have similar interests. (This is just to explain).</li></ul><h3>Conclusion</h3><p>So to conclude, KNN is a simple and easy-to-learn algorithm that can be used for both regression and classification. It works by using a hyperparameter k value which finds the nearest neighbors to the new data point.</p><h4>References:</h4><ul><li>Internet</li></ul><p>Well, that’s the end of KNN. More advanced concepts for another article. Let us meet at the next one. If you enjoy this content, giving it some claps👏 will give me a little extra motivation.</p><p>You can reach me at:</p><p>LinkedIn: <a href="https://www.linkedin.com/in/pranay16/">https://www.linkedin.com/in/pranay16/</a></p><p>GitHub: <a href="https://github.com/pranayrishith16">https://github.com/pranayrishith16</a></p><p>Kaggle: <a href="https://www.kaggle.com/pranayrishith16">https://www.kaggle.com/pranayrishith16</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4b30b37f151" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/understanding-k-nearest-neighbors-a-simple-approach-to-classification-and-regression-e4b30b37f151">Understanding K-Nearest Neighbors: A Simple Approach to Classification and Regression</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lenet in Computer Vision: A Comprehensive Study]]></title>
            <link>https://medium.datadriveninvestor.com/lenet-in-computer-vision-a-comprehensive-study-510b7de8251e?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/510b7de8251e</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 06:54:47 GMT</pubDate>
            <atom:updated>2023-02-25T05:05:10.595Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understand LeNet: Earliest CNN architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fwNd6h7svcS03ylP" /><figcaption>Photo by <a href="https://unsplash.com/@nordwood?utm_source=medium&amp;utm_medium=referral">NordWood Themes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Lenet</h3><p>Lenet is a convolutional neural network architecture proposed by Yann LeCun in 1998. It was one of the earliest CNN architectures developed.</p><p>The idea for Lenet started in 1989, when deep learning, specifically backpropagation, was used for various applications. LeCun then created a convolutional neural network to identify handwritten digits provided by the U.S Postal Service. Research and development continued until 1998, with fine refinements made to the architecture for a single use case: identifying numbers.</p><p>This became Lenet, conventionally known as Lenet-5. It consists of up to 7 layers, 5 of which are important: 3 convolutional layers and 2 fully connected layers.</p><p>Although Lenet is not as good as today’s architectures, it provides an entry path towards learning CNN.</p><h4>Application:</h4><ul><li>Lenet was primarily built to recognize handwritten digits provided by US postal service.</li></ul><h4><strong>Pros:</strong></h4><ul><li>As the architecture has fewer layers and parameters, it is very efficient.</li><li>It performs very well on recognizing handwritten digits (the primary reason for its creation) and can also be used for other projects with minor adjustments.</li><li>As the first architecture, it is simple and easy to understand, making it an excellent starting point for learning CNN.</li></ul><h4><strong>Cons:</strong></h4><ul><li>Lenet-5 has only 5 layers, making it limited for other complex tasks such as object detection or segmentation.</li><li>It also has limited scalability, as it may not scale well for larger datasets.</li></ul><h3>Architecture</h3><p>As the name suggests, Lenet-5 has 5 layers: 3 convolutional layers and 2 fully connected layers. Additionally, it has 2 average pooling layers, which do not count as main layers. Before diving into the architecture, you need to know what a CNN is and what its core elements are. If you need a refresher, check out this here.</p><p><a href="https://pub.towardsai.net/an-introduction-to-cnns-understanding-the-basics-88986fb3c6d1">An Introduction to CNNs: Understanding the Basics</a></p><p>Lets dive in,</p><p><strong>Input:</strong></p><ul><li>The input size is 28x28x1. This means it has 28 pixels of height and width and has 1 channel (<strong>Grayscale</strong>).</li></ul><p><strong>Layer 1 (Convolutional Layer 1):</strong></p><ul><li>Input: 28x28x1</li><li>Number of Filters: 6</li><li>Filter Size: 5x5</li><li>Strides: 1</li><li>Padding: 1</li><li>Activation Function: Tanh</li><li>Output Size (Feature map size): 28x28x6</li></ul><blockquote>Note: Padding is used to maintain the same output size as the input size.</blockquote><p><strong>Layer 2(Average Pooling Layer 1):</strong></p><ul><li>Input size: 28x28x6</li><li>Pool size: 2x2</li><li>Stride: None <em>(By default it is None which means its equal to pool size)</em></li><li>Output Size: 14x14x6</li></ul><p><strong>Layer 3(Convolutional Layer 2):</strong></p><ul><li>Input: 14x14x6</li><li>Number of Filters: 16</li><li>Filter Size: 5x5</li><li>Strides: 1</li><li>Padding: — <em>(not required)</em></li><li>Activation Function: Tanh</li><li>Output Size (Feature map size): 10x10x16</li></ul><p><strong>Layer 4(Average Pooling Layer 2):</strong></p><ul><li>Input size: 10x10x16</li><li>Pool size: 2x2</li><li>Stride: None <em>(By default it is None which means its equal to pool size)</em></li><li>Output Size: 5x5x16</li></ul><p><strong>Layer 5(Convolutional Layer 3):</strong></p><ul><li>Input: 5x5x16</li><li>Number of Filters: 120</li><li>Filter Size: 5x5</li><li>Strides: 1</li><li>Padding: —<em> (Not required)</em></li><li>Activation Function: Tanh</li><li>Output Size (Feature map size): 1x1x120</li></ul><p><strong>Layer 6(Fully-Connected Layer 1):</strong></p><ul><li>Input size: 1x1x120</li><li>Activation Function: Tanh</li><li>Output Size: 84</li></ul><p><strong>Layer 7(Fully-Connected Layer 2):</strong></p><ul><li>Input size: 84</li><li>Activation Function: Softmax</li><li>Output Size: 10</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b79149ae4686a8324fe043631667e46f/href">https://medium.com/media/b79149ae4686a8324fe043631667e46f/href</a></iframe><h3>Code</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1283b2069a1d3fb37fe043cd2605dcfa/href">https://medium.com/media/1283b2069a1d3fb37fe043cd2605dcfa/href</a></iframe><pre>Model: &quot;sequential&quot;<br>_________________________________________________________________<br>Layer (type)                 Output Shape              Param #   <br>=================================================================<br>conv2d (Conv2D)              (None, 28, 28, 6)         156       <br>_________________________________________________________________<br>average_pooling2d (AveragePo (None, 14, 14, 6)         0         <br>_________________________________________________________________<br>conv2d_1 (Conv2D)            (None, 10, 10, 16)        2416      <br>_________________________________________________________________<br>average_pooling2d_1 (Average (None, 5, 5, 16)          0         <br>_________________________________________________________________<br>conv2d_2 (Conv2D)            (None, 1, 1, 120)         48120     <br>_________________________________________________________________<br>flatten (Flatten)            (None, 120)               0         <br>_________________________________________________________________<br>dense (Dense)                (None, 84)                10164     <br>_________________________________________________________________<br>dense_1 (Dense)              (None, 10)                850       <br>=================================================================<br>Total params: 61,706<br>Trainable params: 61,706<br>Non-trainable params: 0<br>_________________________________________________________________</pre><p>That&#39;s it for now. Lenet is one of the earliest CNN architectures, and I hope you enjoyed reading about it. If you found this useful, please give it a few claps 👏 to give me an extra boost.</p><p>You can reach me at:</p><p>LinkedIn: <a href="https://www.linkedin.com/in/pranay16/">https://www.linkedin.com/in/pranay16/</a></p><p>Github: <a href="https://github.com/pranayrishith16">https://github.com/pranayrishith16</a></p><p>Subscribe to DDIntel <a href="https://ddintel.datadriveninvestor.com/">Here</a>.</p><p>Visit our website here: <a href="https://www.datadriveninvestor.com/">https://www.datadriveninvestor.com</a></p><p>Join our network here: <a href="https://datadriveninvestor.com/collaborate">https://datadriveninvestor.com/collaborate</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=510b7de8251e" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/lenet-in-computer-vision-a-comprehensive-study-510b7de8251e">Lenet in Computer Vision: A Comprehensive Study</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Machine Learning Performance Metrics]]></title>
            <link>https://pub.towardsai.net/understanding-machine-learning-performance-metrics-975f390e67e7?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/975f390e67e7</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Sun, 12 Feb 2023 16:01:16 GMT</pubDate>
            <atom:updated>2023-02-12T16:01:16.013Z</atom:updated>
            <content:encoded><![CDATA[<h4>Evaluating the Effectiveness of Your Models</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r-24Ira2bi2qXoNj" /><figcaption>Photo by <a href="https://unsplash.com/@mcverry?utm_source=medium&amp;utm_medium=referral">Mikail McVerry</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I’m sure you’re familiar with machine learning, so let’s not discuss it further. There are several types of machine learning, such as supervised and unsupervised learning. Let’s focus on supervised learning.</p><p>Supervised learning involves training a computer with labeled data in order to predict new data points. It is further divided into two subcategories: regression and classification. Each has its own performance metrics.</p><h3>Classification</h3><p>Classification is a supervised learning algorithm, which means that the model is trained using labeled data to predict the class to which a given data point belongs. The dependent variable is categorical, meaning it has two or more classes.</p><p>Examples of classification include determining whether an email is spam or not.</p><p>Let’s discuss some performance metrics of classification.</p><h4>Confusion Matrix</h4><p>Seeing the name don’t get confused 😂. In machine learning, a classification problem is used to define something as either 0 or 1. But how do we find out if the model has correctly classified something? This is where the confusion matrix comes into play. A confusion matrix is a [0,1] matrix or table which explains comprehensively how good our model is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KJxyvyyAYa1hoHi0z8tkQA.png" /><figcaption>Image by author</figcaption></figure><p>The figure above is a <strong>confusion matrix</strong>. Let’s break it down. This matrix has two-row headings (<strong>Predicted YES</strong> and <strong>Predicted NO</strong>) and two-column headings (<strong>Actual YES</strong> and <strong>Actual NO</strong>). The <strong>Actual</strong> heading refers to the classes defined in the dataset, while <strong>the Predicted</strong> refers to the classes predicted.</p><p>Let’s take an example and, if possible, use it throughout the article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qoZLaooXvpeyHyD6Iyrj6g.png" /><figcaption>Image by author</figcaption></figure><p>The data is provided solely for illustrative purposes.</p><p>The table above displays four features, with <strong>Enjoy Sport</strong> as the dependent variable to be predicted. The <strong>Enjoy Sport</strong> column is the actual column in the confusion matrix, while the predicted values are placed in the predicted row.</p><p>As you can see, a confusion matrix has four values: true positives, true negatives, false positives, and false negatives. Let’s dive deeper.</p><p><strong>True Positive</strong></p><ul><li>This value indicates the number of data points the model correctly predicted as positive when compared to the actual values. In other words, the model predicted “<strong>YES</strong>” when the actual value was “<strong>YES</strong>”.</li></ul><p><strong>True Negative</strong></p><ul><li>This value indicates the number of data points the model correctly predicted as negative when compared to the actual values. In other words, the model predicted “<strong>NO</strong>” when the actual value was “<strong>NO</strong>”.</li></ul><p><strong>False Positive (ERROR)</strong></p><ul><li>This value indicates the number of data points the model has incorrectly predicted as negative when compared to the actual values. For example, the model predicted “<strong>NO</strong>” when the actual value was “<strong>YES</strong>”.</li></ul><p><strong>False Negative (ERROR)</strong></p><ul><li>This value indicates the number of data points the model has incorrectly predicted as positive when compared to the actual values. For example, the model predicted “<strong>YES</strong>” when the actual value was “<strong>NO</strong>”.</li></ul><p>The Confusion Matrix can provide insight into the quality of the model by showing how many correct and incorrect predictions it has made. It is particularly useful for assessing the following few performance metrics.</p><h4>Accuracy</h4><p>Accuracy is a metric that measures how well a model predicts the correct output for given data points. It is calculated by dividing the number of correct predictions made by the model by the total number of predictions made.</p><p>For example, consider the above example: accuracy is the percentage of correct predictions, regardless of whether they are “yes” or “no,” out of the total number of predictions.</p><p>Mathematically, accuracy is calculated as follows:</p><ul><li>Accuracy = (correct predictions) / (total number of predictions)</li></ul><p>For example, if the total number of predictions is 100 and the model predicts 73 correctly, then the accuracy is 73%.</p><p>If we use a confusion matrix, then we can get a much more simple and significant formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1vl8UJ6JBGX7booJtN61JQ.png" /><figcaption>Image by author</figcaption></figure><h4>Precision</h4><p>This is a metric that defines how accurately the model has predicted with respect to a specific class. It is calculated by dividing the number of true positives by the total number of positive predictions made.</p><p>It is calculated as,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*WJXLqy4RxWALg5JIhpmVow.png" /><figcaption>Image by author</figcaption></figure><p>where,</p><ul><li>TP refers to the number of values where the model predicted <strong>YES</strong>, and the actual value was also <strong>YES</strong>.</li><li>FP is the number of values where the model predicted <strong>YES</strong>, but the actual value was <strong>NO</strong>.</li></ul><h4>Recall</h4><p>This measure defines how many positive classes the model can correctly identify. It is calculated by dividing the number of true positive predictions by the total number of actual positives.</p><p>It is calculated as,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*kD2R3JHZ7I2iqhyIuxyJmQ.png" /><figcaption>Image by author</figcaption></figure><p>where,</p><ul><li>TP: the number of values where the model predicted <strong>YES</strong> and the actual value was also <strong>YES</strong>.</li><li>FN: the number of values where the model predicted <strong>NO</strong>, but the actual value was <strong>YES</strong>.</li></ul><h4>F1 score</h4><p>This metric combines recall and precision and is calculated as the harmonic mean of the two. It is mainly used to evaluate the effectiveness of a classification model.</p><p>This can be calculated as,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XkSQhqeQlyNppmE6nGVe1w.png" /><figcaption>Image by author</figcaption></figure><p>F1 scores range from 0 to 1, with higher values indicating better performance. A perfect score is achieved when both recall and precision are 1.</p><h3>Regression</h3><p>Regression is a supervised learning algorithm, which means that the model is trained using labeled data to predict a value. The dependent variable is continuous, meaning it is a real number.</p><p>Examples of regression include determining the price of a house in the US (which is a real number).</p><p>Let’s discuss some performance metrics of regression.</p><h4>Mean Squared Error (MSE)</h4><p>This is the most commonly used loss function for regression models. It is calculated by taking the average of the squared differences between the predicted and actual values.</p><p>The formula is as follows,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n7n3JeMcMp7cY_4APk6MnQ.png" /><figcaption>Image by author</figcaption></figure><p>where,</p><ul><li>n is the number of data points</li><li>y_pred is the predicted value</li><li>y is the actual value</li></ul><p>The <strong>Mean Squared Error</strong> (MSE) is a non-negative value. A lower value indicates a better fit of the regression model; values close to 0 indicate the best fit, while values of 1 or more indicate a poor fit.</p><p>MSE is most often used as a loss function when training a machine learning model for regression tasks, as it can be minimized using gradient descent.</p><h4>Mean Absolute Error (MAE)</h4><p>This is a metric used to evaluate the performance of a model in regression tasks. It is calculated by taking the average of the absolute differences between the predicted and actual values. The absolute error of a single data point is calculated as the absolute difference between the predicted and actual values.</p><p>The formula is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qxYhslVFatzxs4f_cXow5Q.png" /><figcaption>Image by author</figcaption></figure><p>where,</p><ul><li>n is the number of data points</li><li>y_pred is the predicted value</li><li>y is the actual value</li></ul><p>The <strong>Mean Absolute Error</strong> (MAE) is a non-negative value. The lower the value, the better the regression model. If the MAE is close to 0, it indicates the best fit; values of 1 or more indicate a poor fit.</p><h4>Root Mean Squared Error (RMSE)</h4><p>This metric is used to evaluate the performance of a regression model. It is calculated by taking the square root of the average of the squared differences between the predicted and actual values.</p><p>The <strong>Mean Squared Error</strong> (MSE) is the average of the squared differences between the predicted and actual values. The <strong>Root Mean Squared Error</strong> (RMSE) is the square root of this value.</p><p>The formula is as follows,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cCZaeLZppXFIbT5vn0LyFQ.png" /><figcaption><em>Image by author</em></figcaption></figure><p>where,</p><ul><li>n is the number of data points</li><li>y_pred is the predicted value</li><li>y is the actual value</li></ul><p>The <strong>Root Mean Squared Error</strong> (RMSE) is a non-negative value. A lower RMSE indicates a better fit of the regression model; values close to 0 indicate the best fit, while values of 1 or more indicate a poor fit. Compared to the Mean Squared Error (MSE), RMSE tends to have smaller values, making it easier to interpret.</p><h4>R-Squared (R²)</h4><p>R-squared is a statistical measure that indicates how well a regression model fits the data. An ideal R-squared value is 1, meaning the model fits perfectly. The closer the R-squared value is to 1, the better the model fits the data.</p><p>The total sum of squares is calculated by the summation of squares of perpendicular distance between data points and the average line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tL84wEByMkqQm-wMe1HmiA.png" /><figcaption>Image by author</figcaption></figure><p>The residual sum of squares (SSres) is calculated by summing the squares of the perpendicular distances between data points and the best-fitted line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*E5TbeWNqRrvFTNM5kgR6Aw.png" /><figcaption>Image by author</figcaption></figure><p>R-Squared’s formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BZVoVP7Anr2HjN2hegrHHA.png" /><figcaption>Image by author</figcaption></figure><p>Where,</p><ul><li><strong>SSres</strong> is the residual sum of squares</li><li><strong>SStot</strong> is the total sum of squares.</li></ul><p>The goodness of fit of regression models can be evaluated using the R-square method. The higher the value of the R-square, the better the model is.</p><p>I hope I’ve helped you understand some fundamental concepts about performance measurements. If you enjoy this content, giving it some claps👏 will give me a little extra motivation.</p><p>You can reach me at:</p><p>LinkedIn: <a href="https://www.linkedin.com/in/pranay16/">https://www.linkedin.com/in/pranay16/</a></p><p>Github: <a href="https://github.com/pranayrishith16">https://github.com/pranayrishith16</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=975f390e67e7" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/understanding-machine-learning-performance-metrics-975f390e67e7">Understanding Machine Learning Performance Metrics</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to CNNs: Understanding the Basics]]></title>
            <link>https://pub.towardsai.net/an-introduction-to-cnns-understanding-the-basics-88986fb3c6d1?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/88986fb3c6d1</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Wed, 25 Jan 2023 13:11:43 GMT</pubDate>
            <atom:updated>2023-01-25T13:11:43.693Z</atom:updated>
            <content:encoded><![CDATA[<h4>Exploring how powerful CNN is: from basics</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mxdPKHYfMWWA8VO3" /><figcaption>Photo by <a href="https://unsplash.com/@dnevozhai?utm_source=medium&amp;utm_medium=referral">Denys Nevozhai</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QgxkLlnoFCdhkYc_uFZ5jA.png" /><figcaption>CNN <a href="https://arxiv.org/pdf/1703.03091.pdf">Source</a></figcaption></figure><ul><li>Convolutional neural networks are a deep learning concept that was specifically built for processing images. Machine learning is a concept where a computer learns from past experiences. Deep Learning is an advanced part of machine learning. CNN is designed to find visual patterns.</li><li>When we humans see images, we see objects, colors, etc. We learn these things as we grow up, but computers can only understand 0’s and 1’s, i.e., binary values. Then how will computers see images?</li><li>Every image is made up of pixels. The below image is a good depiction of how a computer reads images. There are two types of images, Grayscale and Color. Grayscale(black and white) is made up of an array of values that range from 0 to 255(black to white). Color images have 3 arrays, red array, green array, and blue array(RGB). Also each of those arrays ranging from 0 to 255(black to corresponding colors).</li></ul><figure><img alt="It is an grayscale image on the left and the same image in pixel number(how computer reads images)" src="https://cdn-images-1.medium.com/max/548/1*wvwKZbEuhCG1GSeLnZm6Mg.png" /><figcaption>MIT deep learning lecture 3 <a href="https://introtodeeplearning.com/slides/6S191_MIT_DeepLearning_L3.pdf">source</a></figcaption></figure><p>If a grayscale image has a size of 1080x1080 then the total number of values is 1080x1080x1 whereas a color image has 1080x1080x3(3 as in R+G+B).</p><h3>Architecture</h3><p>A convolutional neural network has 3 types of layers: convolution layer, pooling layers, and fully connected layers.</p><h4>Convolutional Layers</h4><p>The convolutional Layer is the layer where important features are extracted from input images. This layer uses a small square to extract features from the input image. This small square is called a kernel or filter. To explain, There is a mathematical operation in this layer between the input image and a filter in order to preserve and extract features. This is called Feature extraction in CNN.</p><blockquote>Size of feature map: n-f+1</blockquote><blockquote>n = size of input</blockquote><blockquote>f = size of filter</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fx7giU0aB7EbQueO-XLKJg.gif" /><figcaption>By author</figcaption></figure><p>With different filters, different operations can be performed like edge detection, blur, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WKglBn_03vQlGE-oTD2sw.png" /><figcaption>MIT deep learning lecture 3 <a href="https://introtodeeplearning.com/slides/6S191_MIT_DeepLearning_L3.pdf">Source</a></figcaption></figure><p>To perform a convolution operation, a filter should be specified as a certain size. The filter moves across the input image matrix and multiplies values with filter and summing. The result is smaller in size than the input image matrix size. <br>To sum up, in CNN convolutional layer is the most important step or layer. This is used to extract important features from the input image matrix. A CNN can consist of any number of convolutional layers.</p><h4>Non-Linear Layer</h4><p>This layer is added after every convolutional layer to introduce non-linearity to the matrix. Non-linearity is introduced so that the output is not affected by the input or the output is not proportional to the input. This nonlinearity is done by activation functions. That topic is for another article.</p><p>Why do we need non-linearity in the neural network? might be a question. If the data doesn’t have non-linearity, then the input is directly influencing the output, and it doesn’t matter how many layers we use. The outcome will be the same. By increasing the power of non-linearity, the network is created to find more new and unique patterns in the data.</p><p>The commonly used activation functions are RELU, Tanh, etc.</p><h4>Padding</h4><p>Now you have understood how important is the convolutional layer. A kernel or filter is used to extract important features. I mentioned that the convolutional layer could be used any number of times, and every time the size of the feature map decreases. We don’t need that. Consider an input matrix of 5x5 and a filter of size 3x3. The size of the feature map is 5–3+1 = 3. If we add another layer, then the size is 1.</p><p>To make a feature map of size of same as the input matrix, we use padding. Let’s reverse engineer. We need a feature map of size 5. The filter size is 3. from the above formula, n = 5+f-1 = 5+3–1 = 7. We need an input matrix of size 7 from a size 5 input matrix. We add padding, i.e., a row on top, bottom, and column on left and right, giving a matrix of size 7x7. now the math, n-f+1 = 7–3+1 = 5. Hence proved.</p><blockquote>Padding formula = n+2p-f+1</blockquote><blockquote>p = padding</blockquote><p>If p = 1, then one row and one column, so thats why we add 2p, so we get 2 rows and 2 columns.</p><p>The above-added rows and columns are filled with zeros, called as zero padding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BKBuwin_WZMaVrQrMLbZeQ.png" /><figcaption>by author</figcaption></figure><p>This is how padding is applied.</p><h4>Strides</h4><p>We talked about filters in the convolutional layer. Strides are defined as the number of pixels to move in any direction to apply the filter. If the stride is [1,1], then the filter moves 1 pixel at a time in either direction, and if it is [2,2] then the filter moves 2 pixels in either direction.</p><p>This parameter is mainly useful when there is an input image with high resolution, then more pixels to filter. The larger the stride, the smaller the convolution features map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*DI12POk-Ewxzmh28_YCaZQ.gif" /><figcaption>by author</figcaption></figure><p>A [1,1] looks like the above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*rlW-myNrtkAbBC9eOHG9oA.gif" /><figcaption>by author</figcaption></figure><p>A [2,2] stride looks like the above.</p><p>To summarize, Strides is a value where the kernel or filter will move on the input matrix.</p><h4>Pooling Layers</h4><p>If deducing the input image to 1/4 determines what the whole image depicts, then it is no good in processing the whole image. This is where pooling comes into place.</p><p>This is the layer where the large feature matrix is reduced by retaining features. This is called spatial spacing. Pooling also has a kernel and strides. There are different types of spatial spacing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*ZKyHXibGCCC1R6J-53R2zQ.gif" /><figcaption>by author</figcaption></figure><ul><li>Max Pooling: This is where the largest element in the filter is selected.</li><li>Min Pooling: This is where the least element in the filter is selected.</li><li>Mean Pooling: This is the mean of all the elements in the filter.</li><li>Average Pooling: This is the average of all the elements in the filter.</li></ul><p>This pooling layer is mainly used to connect Convolutional Layer and the Fully connected layer. The main reason the pooling layer is used after the convolutional layer because to reduce feature map size to save computational resources.</p><h4>Fully Connected Layers</h4><p>So until now, we have received a matrix with important features. This matrix is flattened into a 1d vector and feeding it into a fully connected neural network. It is called a fully connected layer because each and every neuron is connected to each neuron in the next layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oLt7KT7CiPhDJx5R.png" /><figcaption>Fully connected layer, <a href="https://www.oreilly.com/library/view/tensorflow-for-deep/9781491980446/ch04.html">Image source</a></figcaption></figure><p>The output layer basically uses the softmax activation function. Softmax activation is used, so the sum of all the probabilities of output is 1. From here, the network acts as a neural network.</p><h4>Conclusion:</h4><p>CNN is a deep learning concept to extract features and patterns from images. CNN is a basic ANN but has 2 more layers called the convolutional layer and the pooling layer.</p><p>CNN mostly benefits from the healthcare industry.</p><h3>References:</h3><p><a href="https://introtodeeplearning.com/slides/6S191_MIT_DeepLearning_L3.pdf">MIT Deep learning — Lecture 3</a></p><p>Well, this the what I learned about CNN. More advanced concepts for another article. Let us meet at the next one. If you enjoy this content, giving it some claps👏 will give me a little extra motivation.</p><p>You can reach me at:</p><p>LinkedIn: <a href="https://www.linkedin.com/in/pranay16/">https://www.linkedin.com/in/pranay16/</a></p><p>GitHub: <a href="https://github.com/pranayrishith16">https://github.com/pranayrishith16</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88986fb3c6d1" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/an-introduction-to-cnns-understanding-the-basics-88986fb3c6d1">An Introduction to CNNs: Understanding the Basics</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Machine Learning is Revolutionizing Industries?]]></title>
            <link>https://medium.datadriveninvestor.com/how-machine-learning-is-revolutionizing-industries-d99ae6ce7894?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d99ae6ce7894</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Sat, 21 Jan 2023 06:32:23 GMT</pubDate>
            <atom:updated>2023-01-25T05:43:02.639Z</atom:updated>
            <content:encoded><![CDATA[<h4>Transforming Industries: How Machine Learning is Driving Innovation and Efficiency</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fWm4yFS9DdDAIKQi" /><figcaption>Photo by <a href="https://unsplash.com/@ronan18?utm_source=medium&amp;utm_medium=referral">Ronan Furuta</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Over the past decade, industries have evolved a lot. They started using more automated systems and robots. Industries started incorporating Machine learning into their techniques.</p><p>In recent years, machine learning is being used in industries from healthcare to transportation. These industries have a huge amount of unstructured data. To deduce an explanation or pattern, those industries need to hire Machine Learning engineers, Data scientists, etc.</p><p>Now let’s see which industries use machine learning and what type of data they have:</p><h4>Healthcare</h4><p>Healthcare is a very huge industry. This consists of hospitals, pharma, etc. Let it be government hospitals or private hospitals, each of them has its database of patients. This data consists of their age, symptoms, diagnosis, medication, etc. Doctors use machine learning with this data. The data might be unstructured but there are specific features that help them. Machine learning models are created using this patient’s past data. As each patient is unique, symptoms can also be unique. Doctors use this machine learning to diagnose but not 100% but also have their assumptions.</p><p>For example, doctors use machine learning to find abnormalities in CT scans or MRI scans, this helps doctors to make an accurate diagnosis. Machine learning can also be used to predict the likelihood of a patient developing a specific condition based on the patient’s previous data. As machine learning models work on accuracy, doctors or hospitals don’t always rely on those models, but also scientific provings. Machine learning models are used to just predict the outcomes, just like a second opinion for a patient. Machine learning is also used for treatment planning. For example, there is a patient with a certain condition and machine learning will help to find other patients with the same symptoms, then the doctor can prescribe the same treatment to other patients.</p><p>This way machine learning is revolutionizing the healthcare industry.</p><h4>Finance</h4><p>Machine learning is used by banks in different ways. Firstly they use to analyze individual account holders’ financial data and provide them with some eye-catching loans etc. This lets them earn money.</p><ul><li>Banks also use machine learning to find patterns in previous financial transactions, this lets them identify fraudulent transactions and prevent any sort of financial losses.</li><li>Banks enable account holders to invest in stocks. Not all of them know how to invest in the stock market, banks use past stock data and provide insights on which stock to purchase.</li></ul><p>Banks use machine learning but they don’t tend to show how they use it.</p><h4>Transportation</h4><p>Machine learning is used in different aspects of transportation:</p><ul><li>Things might be absurd if I call out transportation, but my main aim is an industry like cabs. You, people, might have heard of Uber. Uber is a technology company that provides ride-hailing or cabs. Uber completely relies on machine learning. Uber uses various data to interpret the congestion on roads or demand or weather in a city. This helps uber to predict the price of a ride. Uber completely revolutionized transportation and machine learning is behind it.</li><li>Used for traffic optimization. All the traffic lights are computer operated with some people supervising them. This data is used by machine learning to find patterns in how the traffic occurs and when the traffic occurs.</li><li>The main key component is Autonomous vehicles. This doesn’t come under transportation but vehicles do come in. Machine learning is the core part of autonomous vehicles like tesla, reverse park assists in Audi, Ford, etc.</li></ul><p>There are many more industries where machine learning is revolutionizing. That it for now. If you enjoy this content, giving it some claps👏 will give me a little extra motivation.</p><p>You can reach me at:</p><p>LinkedIn : <a href="https://www.linkedin.com/in/pranay16/">https://www.linkedin.com/in/pranay16/</a></p><p>Github : <a href="https://github.com/pranayrishith16">https://github.com/pranayrishith16</a></p><p>Subscribe to DDIntel <a href="https://ddintel.datadriveninvestor.com/">Here</a>.</p><p>Visit our website here: <a href="https://www.datadriveninvestor.com/">https://www.datadriveninvestor.com</a></p><p>Join our network here: <a href="https://datadriveninvestor.com/collaborate">https://datadriveninvestor.com/collaborate</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d99ae6ce7894" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/how-machine-learning-is-revolutionizing-industries-d99ae6ce7894">How Machine Learning is Revolutionizing Industries?</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-World Examples of Machine Learning in Action]]></title>
            <link>https://ai.plainenglish.io/real-world-examples-of-machine-learning-in-action-da7fb5c6c5bb?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/da7fb5c6c5bb</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Tue, 17 Jan 2023 01:32:21 GMT</pubDate>
            <atom:updated>2023-01-18T04:42:05.810Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9YDKCafpO1JiIgzo" /><figcaption>Photo by <a href="https://unsplash.com/@nampoh?utm_source=medium&amp;utm_medium=referral">Maxim Hopman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Machine learning is a type of artificial intelligence that allows computers to learn from past experiences. Machine learning has a variety of applications. Let me explain some real-world examples:</p><h4>Netflix</h4><ul><li>Netflix was a mail-based rental business. When there was no internet, Netflix would sell movies and series in form of DVDs in the mail. When the internet was becoming a trend, Netflix launched its Video-on-demand streaming service.</li><li>Now Netflix is on a different level. Netflix has thousands of movies, adding new movies every day. Each user has their own set of movies on the homepage. How is that possible?</li><li>Netflix uses a Recommendation system, where based on the user’s likings, dislikings movies and series are recommended which is far more accurate than any recommendation system in the same field. But still, those recommendation systems are part of machine learning so doesn’t have 100% accuracy.</li><li>The Netflix recommendation system is built using data from past users, starting from when the company first offered DVDs on a subscription model. As the number of users has increased, the model has learned and made much better recommendations.</li></ul><h4>Amazon</h4><ul><li>I am not talking about the forest in south America but e-commerce giant Amazon.com. Amazon sells everything available in the world (over exaggeration 😂).</li><li>As you open Amazon, you can see the things you previously viewed and also some other things related to the thing you viewed. This is done by again recommendation system. Based on your preferences, price, and type, you are provided with precise recommendations that you might be interested in. Personalized product recommendations are what amazon’s aim is.</li><li>Amazon also uses machine learning for product forecasting. This makes sure there is enough stock based on the demand for the product at the right time.</li></ul><h4>Instagram</h4><ul><li>Every day millions of people use Instagram and I say that people are addicted to Instagram. Instagram also uses machine learning but in a different form called recommendation systems.</li><li>Recommendation systems are where you are provided with recommendations based on your characteristics like your age, the accounts you follow, and the posts you have liked. Using this data, real-time recommendations are provided.</li><li>Instagram also uses machine learning to rank posts, based on their content which helps the post to react a certain number of likes.</li></ul><h4>Tesla</h4><ul><li>Everyone knows about tesla. It’s owned by Elon musk. Tesla is an automotive company that manufactures cars and clean energy solar panels. For now, let’s just talk about their cars.</li><li>Tesla Cars range as S,3, X, and Y models. All models have sophisticated features and autonomous driving capabilities. All cars are equipped with sensors that record real-world footage and make decisions based on it.</li><li>Tesla cars have limited autonomous capability because their system is not 100% accurate. However, it is still very good. Tesla cars use their cameras (previously, they used radar and LiDAR) to record real-time data, creating a pattern based on it and making decisions in real time. For example, if a car stops suddenly in front of a Tesla, the Tesla will sense the sudden drop in speed and try to avoid an accident by braking and moving away.</li><li>These algorithms are trained on large datasets of real-world examples, which allows them to recognize patterns and make predictions about how to respond to different situations on the road. The more data that is available for training, the better the system can perform in a variety of conditions.</li></ul><p>Well these are some real world actions done by machine learning. Lets meet on next one. If you enjoy this content, giving it some claps👏 will give me a little extra motivation.</p><p>You can reach me at:</p><p>LinkedIn : <a href="https://www.linkedin.com/in/pranay16/">https://www.linkedin.com/in/pranay16/</a></p><p>Github : <a href="https://github.com/pranayrishith16">https://github.com/pranayrishith16</a></p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>. Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a>, <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>, </em><a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a><em>, and </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></p><p><strong><em>Interested in scaling your software startup</em></strong><em>? Check out </em><a href="https://circuit.ooo/?utm=publication-post-cta"><strong><em>Circuit</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da7fb5c6c5bb" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/real-world-examples-of-machine-learning-in-action-da7fb5c6c5bb">Real-World Examples of Machine Learning in Action</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interview Preparation — DSA day 6]]></title>
            <link>https://medium.com/@pranayrishith/interview-preparation-dsa-day-6-bb1b507bb228?source=rss-d478ca4e1ef0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb1b507bb228</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[interview-preparation]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[interview-experience]]></category>
            <dc:creator><![CDATA[Pranay Rishith]]></dc:creator>
            <pubDate>Wed, 08 Jun 2022 01:42:11 GMT</pubDate>
            <atom:updated>2022-06-08T01:42:11.429Z</atom:updated>
            <content:encoded><![CDATA[<h3>Interview Preparation — DSA day 6</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QLuyl9-65oACL2lc" /><figcaption>Photo by <a href="https://unsplash.com/@windows?utm_source=medium&amp;utm_medium=referral">Windows</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I am back with another random question i learned recently. This is the question i worked in Leetcode.</p><h3>Question: Two Sum</h3><blockquote><strong>Input:</strong> nums = [2,7,11,15], target = 9<br><strong>Output:</strong> [0,1]<br><strong>Explanation:</strong> Because nums[0] + nums[1] == 9, we return [0, 1].</blockquote><blockquote><strong>Input:</strong> nums = [3,2,4], target = 6<br><strong>Output:</strong> [1,2]</blockquote><p><em>SOLUTION: Efficient</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528248%252C231%252C28%252C1%2529%26t%3Dblackboard%26wt%3Dsharp%26l%3Dauto%26width%3D589.25%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D26px%26ph%3D29px%26ln%3Dfalse%26fl%3D1%26fm%3DFira%2BCode%26fs%3D14px%26lh%3D152%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dclass%252520Solution%25253A%25250A%252520%252520%252520%252520def%252520twoSum%2528self%25252C%252520nums%25252C%252520target%2529%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520s%252520%25253D%252520dict%2528%2529%25250A%252520%252520%252520%252520%252520%252520%252520%252520%25250A%252520%252520%252520%252520%252520%252520%252520%252520for%252520i%252520in%252520range%2528len%2528nums%2529%2529%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520if%252520%2528target-nums%25255Bi%25255D%2529%252520in%252520s%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520return%252520%25255Bs%25255Btarget-nums%25255Bi%25255D%25255D%25252Ci%25255D%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520s%25255Bnums%25255Bi%25255D%25255D%252520%25253D%252520i%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528248%25252C231%25252C28%25252C1%252529%26t%3Dblackboard%26wt%3Dsharp%26l%3Dauto%26width%3D589.25%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D26px%26ph%3D29px%26ln%3Dfalse%26fl%3D1%26fm%3DFira%2BCode%26fs%3D14px%26lh%3D152%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dclass%25252520Solution%2525253A%2525250A%25252520%25252520%25252520%25252520def%25252520twoSum%252528self%2525252C%25252520nums%2525252C%25252520target%252529%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520s%25252520%2525253D%25252520dict%252528%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520for%25252520i%25252520in%25252520range%252528len%252528nums%252529%252529%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520if%25252520%252528target-nums%2525255Bi%2525255D%252529%25252520in%25252520s%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520return%25252520%2525255Bs%2525255Btarget-nums%2525255Bi%2525255D%2525255D%2525252Ci%2525255D%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520s%2525255Bnums%2525255Bi%2525255D%2525255D%25252520%2525253D%25252520i%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/62211f5a348d23d1c43dbd22b568681e/href">https://medium.com/media/62211f5a348d23d1c43dbd22b568681e/href</a></iframe><p>We use Dictionary because we need to return the index of the pair. we find the difference and store in the dictionary. When we find the value that is already in the dictionary, we just return both the index.</p><blockquote><em>Time Complexity: O(n)</em></blockquote><blockquote><em>Space Complexity: O(n) because we use dictionary</em></blockquote><p>Well I meet you with another question some other day. Clap for good.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb1b507bb228" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>