<?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 Rohan Negi on Medium]]></title>
        <description><![CDATA[Stories by Rohan Negi on Medium]]></description>
        <link>https://medium.com/@rohanaccuracy66?source=rss-b4bfe55d0035------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kNbLcNIbgnbIeTif</url>
            <title>Stories by Rohan Negi on Medium</title>
            <link>https://medium.com/@rohanaccuracy66?source=rss-b4bfe55d0035------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 13:02:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rohanaccuracy66/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[Statistics for Machine learning.]]></title>
            <link>https://medium.com/@rohanaccuracy66/statistics-for-machine-learning-75a29129dcbf?source=rss-b4bfe55d0035------2</link>
            <guid isPermaLink="false">https://medium.com/p/75a29129dcbf</guid>
            <dc:creator><![CDATA[Rohan Negi]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 12:10:20 GMT</pubDate>
            <atom:updated>2023-01-04T12:10:20.684Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 2 of 4.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*xENLOWA3i5dafHKP_PXvnw.png" /></figure><p><strong>Welcome back learners , I hope you enjoyed the part 1 of the series. In this part we’ll go through some more interesting statistical topics.</strong></p><p><strong>This part will walk through:</strong></p><ul><li>Percentiles.</li><li>Quartiles.</li><li>Five number summary</li><li>Outliers and effects of outliers.</li><li>Probability</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*JqaHKLx_YGk3TYAf.jpg" /></figure><h3>Percentiles</h3><ul><li><strong>Percentiles : </strong>The value below which a percentage of data falls is called as Percentile. Before calculating the percentile you need to sort from smallest to largest in a dataset. <strong>Example :</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*7IosRtR8oddjXhv69gweWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*xsHH5ri-Mo9LuZ4j" /></figure><ul><li><strong>Degree of freedom : </strong>The degrees of freedom is the number of values that are free to vary.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*4wynNX_scrZpc39Mbx9Jrw.png" /></figure><h3>Quartiles</h3><ul><li><strong>1&#39;st Quartile : </strong>The 25 percentile is called as 1st quartile .</li><li><strong>2&#39;nd Quartile :</strong> The 50 percentile is said to be 2nd quartile.</li><li><strong>3&#39;rd Quartile : </strong>The 75 percentile is said to be 3rd quartile.</li></ul><p>formula for quartiles , where n -1 is degree of freedom and percentile is 25,50,75 .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*JEuCOcH_562rXnazmpEHrw.png" /></figure><h3>Five number summary</h3><ul><li>Minimum : The lowest number in the data</li><li>1st Quartile : Q1</li><li>Median : The median is the middle number in a sorted data.</li><li>Third quartile : Q3</li><li>Maximum : The highest number in the data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NdnmutGj45rUOqWy5Hj7Qg.png" /></figure><h3>Outliers</h3><ul><li><strong>Inter quartile range(IQR) :</strong> In simple words , the spread of the data is said as IQR . Q3 - Q1 is IQR</li><li><strong>Lower Fence :</strong> Q1 - 1.5 * (IQR)</li><li><strong>Higher Fence :</strong> Q3 + 1.5 * (IQR)</li></ul><p>The data below the Lower Fence and above the Higher Fence are Outliers . The removal of outliers depends on the domain and also the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AWdIZ932Z5ZiTYSAbc8WrA.png" /></figure><h3>Probability</h3><p>We all have learned probability in our school days . We just need to recall all the things we learned about probability in that days. Probability is a vast term and have many small topics inside it that cant be fully covered in a single article . Probability itself requires a series of article , so we gonna learn only the important topics of probability.</p><ul><li><strong>Mutually exclusive event </strong>: two events are said to be mutually exclusive <strong>if they cannot occur at the same time or simultaneously</strong>. Example : Tossing a coin . We will either get heads or tails , we cant get both at same time . So tossing a coin or throwing a dice are mutually exclusive events.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/0*5XjCzCECcE3Vcsvv.png" /></figure><ul><li><strong>Non mutually exclusive events</strong> : Non-mutually exclusive events are <strong>events that can happen at the same time. </strong>Example <strong>: </strong>In deck of cards what is the probability of choosing a card which is of heart or a king , so both the event can occur together its a non mutually exclusive event .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*PP2OE8GWSQ0e5WRJuqOdsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YEtGYrPxGxzyyoRimRUOjQ.png" /></figure><ul><li><strong>Rules of probability :</strong></li></ul><p><strong>Additional rule : </strong>When two events, A and B, are mutually exclusive, the probability that A or B will occur is the sum of the probability of each event. <strong>P(A or B) = P(A) + P(B)</strong></p><p>When two events, A and B, are non-mutually exclusive, the probability that A or B will occur is:<strong> P(A or B) = P(A) + P(B) — P(A and B)</strong></p><p><strong>Multiplication rule</strong> : If A and B are dependent events, then the probability of both events occurring simultaneously is given by: <strong>P(A ∩ B) = P(B) . P(A|B)</strong></p><p>If A and B are two independent events in an experiment, then the probability of both events occurring simultaneously is given by: <strong>P(A ∩ B) = P(A) . P(B)</strong></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3>Thanks for reading the article . I hope you enjoyed and gained some knowledge from the article . Keep learning :) .</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75a29129dcbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Statistics for Machine learning.]]></title>
            <link>https://medium.com/@rohanaccuracy66/statistics-for-machine-learning-a04ac6a2e91e?source=rss-b4bfe55d0035------2</link>
            <guid isPermaLink="false">https://medium.com/p/a04ac6a2e91e</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[stats-ml-life-sciences]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Rohan Negi]]></dc:creator>
            <pubDate>Mon, 21 Nov 2022 15:27:13 GMT</pubDate>
            <atom:updated>2022-11-21T15:38:10.255Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1 of 4.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*xENLOWA3i5dafHKP_PXvnw.png" /></figure><p>Statistics is the backbone of Machine Learning. In this series of articles, we will learn and discuss statistics used in machine learning.</p><p><strong>This part will walk through:</strong></p><ul><li>What is statistics in machine learning?</li><li>Different types of statistics.</li><li>Different types of datatypes.</li><li>Measure of central tendency</li><li>Measure of dispersion</li><li>Population and Sample</li><li>Population mean/Population variance vs Sample mean/Sample variance</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZmUMc0hlbWgHAt98.jpg" /></figure><h3>What is statistics?</h3><p>Statistics is the science that deals with methodologies to gather , review, analyse ,visualize ,make insights and draw conclusion from data .</p><h3>Different types of statistics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/0*Ou96nWPGroT-Nj2j" /></figure><ul><li>Descriptive statistics</li><li>Inferential statistics</li></ul><p><strong>Descriptive statistics</strong> :</p><ul><li>Descriptive statistic also known as summary statistic deals with summarizing , visualizing and analyzing the data</li><li>Histogram, Bar plot , pie chart , box plot.</li></ul><p><strong>Inferential statistics :</strong></p><ul><li>Inferential statistics refers to taking sample data and making conclusion for the population data.</li><li>The goal of inferential statistics is to draw conclusions from a sample and generalize them to a population.</li><li>Regression analysis , Hypothesis tests.</li></ul><h3>Different types of data types</h3><ul><li><strong>Numeric data</strong> : Discrete data, Continuous data</li><li><strong>Categorical data : </strong>Nominal data , Ordinal data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*DA8WgCKS53ZH7Mbg" /></figure><p><strong>Numeric data</strong></p><p>Discrete data : When values in a data set are countable and can only take certain values, it is called discrete data. Example :- Number of people in family</p><p>Continuous data: Continuous Data can take any value (within a range). Example :- Height, Age of people</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*FnuT6PDH7OWUM1pzu507SQ.png" /></figure><p><strong>Categorical data</strong></p><p>Nominal data : Denotes labels or categories (e.g. blonde hair, brown hair)</p><p>Ordinal data : refers to data that can be categorized and also ranked according to some kind of order or hierarchy (e.g. low income, medium income, high income, rank in class).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*cbtXbkwmcUc5ZQ0xfIlOAQ.png" /></figure><h3>Measure of central tendency</h3><ul><li>Mean ,Median ,Mode.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*MAnQk6umiah9t2ftjHfqOQ.png" /></figure><p><strong>Mean </strong>: The arithmetic mean of a given data is the sumof all observations divided by the number of observations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*8kGbjES2fUzzn0x3owqEOA.png" /></figure><p><strong>Median : </strong>The median is the middle value of the dataset . First arrange the number in numerical order then find the middle number. If n(total number of values) is odd(7) number then (7 + 1)/2 = 4th number will be the median . If n(total number of values) is even(8) number then (8 + 2)/2 = 5th number will be the median(we can also take the half of the sum of the 2 middle numers).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/0*rcaIDJoitlu8_2zo" /></figure><p><strong>Mode : </strong>The mode is the most common value in a set of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*b5msw8t069HvIauaQX6IlQ.png" /></figure><p><strong>Skewness effect and use of central tendency</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*WMZXdLRZYzE3bkwd0LF6qA.png" /></figure><p>Mode mostly used for categorical features</p><h3>Measure of dispersion</h3><p>Dispersion helps to understand the distribution of the data. <strong>Example</strong> : Data1 = 1,3,5 : mean =3 . Data2 = 1,2,6 : mean =3 . In such case measure of central tendency(mean ) is same, but the distribution is not same. So , how can we distinguish the distribution of the both data? Measure of dispersion will help us to make the distinguish between them.</p><ul><li><strong>Range : </strong>The difference between the smallest and the largest observations in the sample is called Range. Xmax — Xmin. <strong>Example</strong>: 1, 3,5, 6, 7 =&gt; Range = 7 -1= 6</li><li><strong>Variance</strong> : The other better technique to measure of dispersion in a data set. <strong>Example</strong> : The below figure shows that On an avg how far point is distributed from the mean (x̄). Here(left side) variance is high because, from the mean(x̄), the points are distributed at a longer distance as compared to the right side, where the distance is a bit smaller.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HRJgRByGfjkQsBXY" /></figure><ul><li><strong>Standard Deviation:</strong> The square root of the variance is known as the standard deviation.Standard deviation tells us about the concentration of data around the mean of the data set.If the standard deviation is small, the data has little spread (i.e., the majority of points fall very near the mean).If standard deviation = 0, there is no spread. This only happens when all data items are the same value.</li></ul><h3>Population &amp; Sample</h3><ul><li><strong>Population</strong> : A population is the entire group that you want to draw conclusions about.</li><li><strong>Sample </strong>: A portion, or part, of the population of interest.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*-HS4L3EBVtYG02P1kNiYKQ.png" /></figure><h3>Population mean/Population variance vs Sample mean/Sample variance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*D10WDPT724ydXEfEHUSJPg.png" /></figure><ul><li><strong>Population mean vs Sample mean :</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/0*4yOcVoH0kGUTRnk9" /></figure><ul><li><strong>Population variance vs sample variance :</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J1ewUQZYrMq3bvkW" /></figure><h3>Bonus points</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*kxAIa8--ZOWlWdRLqveG4Q.png" /></figure><p>Thanks for reading the article . I hope you enjoyed and gained some knowledge from the article . Keep learning :) .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a04ac6a2e91e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Train YOLOv5 instance segmentation model on a Custom Dataset with free gpu]]></title>
            <link>https://medium.com/@rohanaccuracy66/how-to-train-yolov5-instance-segmentation-model-on-a-custom-dataset-with-free-gpu-445f7cea57ea?source=rss-b4bfe55d0035------2</link>
            <guid isPermaLink="false">https://medium.com/p/445f7cea57ea</guid>
            <category><![CDATA[instance-segmentation]]></category>
            <dc:creator><![CDATA[Rohan Negi]]></dc:creator>
            <pubDate>Sat, 05 Nov 2022 19:24:10 GMT</pubDate>
            <atom:updated>2022-11-05T19:24:10.218Z</atom:updated>
            <content:encoded><![CDATA[<p>The Yolo of object detection models grows ever stronger with the introduction of <a href="https://github.com/ultralytics/yolov5">YOLOv5</a>. In this post, we will walk through how you can train YOLOv5 segmentation model to detect your custom objects for your use case that with a free gpu.</p><p>We use a <a href="https://universe.roboflow.com/afzal-shaikh-hktui/handgun_train/dataset/4">Hand gun and Person detection</a>, which you can export yourself. You can also use this tutorial on your own custom data.</p><p>To train our detector we take the following steps:</p><ul><li>Install YOLOv5 dependencies</li><li>Download Custom YOLOv5 Object Detection Data</li><li>Define YOLOv5 Model Configuration and Architecture</li><li>Train a custom YOLOv5 Detector</li><li>Evaluate YOLOv5 performance</li><li>Visualize YOLOv5 training data</li><li>Run YOLOv5 Inference on test images</li></ul><p>On to training… I recommend you to use<a href="https://colab.research.google.com/drive/1NQK3wZuUYOa33GuAh1QNR3eN-w8GhZLb?usp=sharing"> YOLOv5 Colab Notebook</a> , which will make it easier for you to train and validate.</p><p>After you open your <a href="https://colab.research.google.com/drive/1NQK3wZuUYOa33GuAh1QNR3eN-w8GhZLb?usp=sharing">Colab Notebook</a> , change your runtime to GPU from CPU</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RaUESvE8nUYwMrlzmlbyGQ.png" /></figure><p>The GPU will allow us to accelerate training time. Colab comes preinstalled with torch and cuda.</p><h3>Installing the YOLOv5 Environment</h3><p>To start off we first clone the YOLOv5 repository and install dependencies.</p><pre>!git clone https://github.com/ultralytics/yolov5  <em># clone repo</em><br>!pip install -r yolov5/requirements.txt  <em># install dependencies</em></pre><pre>%cd /content/yolov5</pre><p>Then, we import same useful libraries</p><pre><strong>import</strong> torch<br>from google.colab.patches import cv2_imshow  <em># for displaying images</em><br></pre><h3>Download Custom YOLOv5 segmentation data</h3><p>In this tutorial we will download object detection data in YOLOv5 format from Roboflow <a href="https://universe.roboflow.com/afzal-shaikh-hktui/handgun_train/dataset/4">Hand gun and Person detection</a>. You can also make your own segmentation data from Roboflow as creating and downloading data in any format is free .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EoTZ3E8IUX9S0LS2NB6mUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*131aoNWy65KP7shzd37YUA.png" /></figure><p>Now paste the generated code in your next cell, the code will look like the below one.</p><p>****Note you can now also download your data with the <a href="https://pypi.org/project/roboflow/">Roboflow PIP Package</a></p><pre>#from roboflow import Roboflow<br>#rf = Roboflow(api_key=&quot;YOUR API KEY HERE&quot;)<br>#project = rf.workspace().project(&quot;YOUR PROJECT&quot;)<br>#dataset = project.version(&quot;YOUR VERSION&quot;).download(&quot;yolov5&quot;)</pre><h3>Define YOLOv5 Model Configuration and Architecture</h3><p>Next we write a model configuration file for our custom object detector. For this tutorial, we chose the smallest, fastest base model of YOLOv5s-seg. You have the option to pick from other YOLOv5-seg models including:</p><ul><li>YOLOv5s-seg</li><li>YOLOv5m-seg</li><li>YOLOv5L-seg</li><li>YOLOv5x-seg</li></ul><p>You can also edit the structure of the network in this step, though rarely will you need to do this.</p><h3>Training Custom YOLOv5 model.</h3><p>To kick off training we running the training command with the following options:</p><ul><li><strong>img:</strong> define input image size</li><li><strong>batch:</strong> determine batch size</li><li><strong>epochs:</strong> define the number of training epochs.</li><li><strong>data:</strong> set the path to our yaml file</li><li><strong>cfg:</strong> specify our model configuration</li><li><strong>weights:</strong> specify a custom path to weights. (Note: you can download weights from the Ultralytics Google Drive <a href="https://drive.google.com/open?id=1Drs_Aiu7xx6S-ix95f9kNsA6ueKRpN2J">folder</a>)</li><li><strong>cache:</strong> cache images for faster training</li></ul><p>And run the training command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhQBNOYJHSLJOj5OyLvAMQ.png" /></figure><pre>%cd /content/yolov5/</pre><pre>!python segment/train.py --img 416 --batch 16 --epochs 100 --data {dataset.location}/data.yaml  --weights yolov5s-seg  --cache</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fVgRRbJUTUKQODhve9A80Q.png" /></figure><h3>Evaluate Custom YOLOv5 Detector Performance</h3><p>Now that we have completed training, we can evaluate how well the training procedure performed by looking at the validation metrics. The training script will drop tensorboard logs in runs. We visualize those here:</p><pre>%load_ext tensorboard</pre><pre>%tensorboard --logdir runs</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kaDmAuKJCx4tqIFyeiVETA.png" /></figure><p>And if you can’t visualize Tensorboard for whatever reason the results can also be plotted with utils.plot_results and saving a result.png.</p><pre>from IPython.display import Image  # for displaying images</pre><pre>from utils.plots import plot_results  # plot results.txt as results.png</pre><pre>Image(filename=&#39;/content/yolov5/runs/train-seg/exp3/results.png&#39;, width=1000)  # view results.png</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RR5Ap3ee3zfnktjcHlBC-w.png" /></figure><p>We stopped training a little early here(100 eppochs). You want to take the trained model weights at the point where the validation mAP reaches its highest with more epoochs.</p><h3>Visualize YOLOv5 training data</h3><p>During training, the YOLOv5 training pipeline creates batches of training data with augmentations. We can visualize the training data ground truth as well as the augmented training data.</p><pre>Image(filename=&#39;/content/yolov5/runs/trainseg/exp3/val_batch0_pred.jpg&#39;, width=900)</pre><h3>Run YOLOv5 Inference on Test Images</h3><p>Now we take our trained model and make inference on test images. After training has completed model weights will save in weights/.</p><p>For inference we invoke those weights along with a conf specifying model confidence (higher confidence required makes less predictions), and a inference source. source can accept a directory of images, individual images, video files, and also a device&#39;s webcam port. For source, I have moved our test/*jpg to test_infer/.</p><pre>!python segment/predict.py --weights runs/train-seg/exp3/weights/best.pt --source ../test_infer</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NiLejb3OqVC67ZgytVyeiQ.png" /></figure><p>Finally, we visualize our detectors inferences on test images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*HbLMrxCSq74oMvM3j3GVFQ.jpeg" /></figure><h3>Congrats!</h3><p>Hope you enjoyed this!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=445f7cea57ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>