<?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 Paritosh Kumar on Medium]]></title>
        <description><![CDATA[Stories by Paritosh Kumar on Medium]]></description>
        <link>https://medium.com/@paritoshkumar-5426?source=rss-89b61b544de0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XfymQjxhd0c8QrBk_R05vA.png</url>
            <title>Stories by Paritosh Kumar on Medium</title>
            <link>https://medium.com/@paritoshkumar-5426?source=rss-89b61b544de0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 13:54:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paritoshkumar-5426/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[Weights Initialization in Neural Network]]></title>
            <link>https://medium.com/analytics-vidhya/weights-initialization-in-neural-network-d962ac438bdb?source=rss-89b61b544de0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d962ac438bdb</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Paritosh Kumar]]></dc:creator>
            <pubDate>Fri, 26 Mar 2021 21:55:21 GMT</pubDate>
            <atom:updated>2021-06-26T20:20:28.773Z</atom:updated>
            <content:encoded><![CDATA[<p>Before that, we have to understand.</p><blockquote><strong>Why we initialize weight?</strong></blockquote><p><em>Weight initialization helps a lot in optimization for deep learning. Without it, SGD and its variants would be much slower and tricky to converge to the optimal weights.<br>The aim of weight initialization is to prevent layer activation outputs from exploding or vanishing during the course of a forward pass through a deep neural network.</em></p><p>Now Let’s understand different ways to initialize the weight.</p><ol><li><strong>Zero Initialization</strong></li></ol><p>Here we are initializing all weights as 0. In this case, all neurons will compute the same thing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9znuMpvyiampmiJS3NEyyQ.jpeg" /></figure><p><strong>a.</strong>Here we are sending the same output to every neuron in the network.<br>It will output the same thing. So we can say the neuron is not learning.</p><p><strong>b.</strong>Even we initialize constant weight. Then same gradient update will be there.<br>These above issues lead to the problem of “Symmetry”.</p><p><strong>2.Initializing weight as large negative numbers.<br></strong>Here we are initializing all weights as large negative numbers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q57xAJUTiE04RMaYVYUDaQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_zrb2LXkTpUbGk4jqPa_RQ.png" /></figure><p>This is the graph of ReLU. So for the negative number output is 0.</p><p>2. <strong>Case 2</strong> → Activation function as sigmoid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YNb2iNYTzGnkqJhpwEb4mQ.png" /><figcaption><a href="https://towardsdatascience.com/derivative-of-the-sigmoid-function-536880cf918e">https://towardsdatascience.com/derivative-of-the-sigmoid-function-536880cf918e</a></figcaption></figure><p>In this case, for very large negative or positive weights. The gradient is very small. Then we have the problem of Vanishing Gradient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*cXAnlzhO1FCX6D98IDjD-Q.jpeg" /></figure><p><strong>Ideal conditions for weights <br><em>a.</em></strong><em>Weights should be not too small<br></em><strong><em>b.</em></strong><em> Weights should not be 0.<br></em><strong>c.</strong><em>Weights has some good variance. With this, each neuron will learn different things.</em></p><p>Now taking the above points into consideration, we will try to initialize the weight.</p><p><strong>Case 1</strong>:<strong>Normal Initialization</strong> : <br>All the weight from Normal Distribution with mean = 0 &amp; variance = small value.</p><p><strong>Advantage :</strong><br>a.Weight has the same variance. <br>b. We have some positive &amp; negative weights.</p><p><strong><em>Some better weights initialization strategy.</em></strong></p><p>Before proceeding, let&#39;s understand two terms “fan_in” &amp; “fan_out”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WpAcQhLF8glc0i5CpfkAoQ.jpeg" /></figure><p>2. <strong>Uniform Initialization<br></strong> It means we can initialize the weights that follow “Uniform Distribution” with<br>the minimum value &amp; maximum values as follows-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OVKnNuKy83ymmtgG81vARA.png" /></figure><p>3. <strong>Xavier / Glorot Initialization <br> </strong>Xavier&#39;s initialization has two variations. We can now check those variations.</p><p><strong><em>a. Variation 1:</em></strong> <em>All weights will come from Normal distribution with mean = 0 and variance for every neuron will be-</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*95Fpfx2J9sUX4_l2bS_AVA.png" /></figure><p>This initialization is known as Glorot Normal or Xavier Normal.</p><p><strong><em>b.Variation 2: </em></strong><em>Xavier/Glorot Uniform.<br>All weights will come from the uniform distribution with the below conditions.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*LpQYliBbM1Xo3emfpxMSXg.png" /></figure><p>Xavier initialization works well with Sigmoid activation.</p><p><strong>4. “He” Initialization <br></strong> It also has two variations. Lets find out</p><p><strong><em>a. Variation 1: He- Normal</em></strong><br><em>All weights will come from Normal distribution with mean = 0 and variance for every neuron will be-</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/155/1*vleGbFqykfMezYj87AeGFQ.png" /></figure><p><strong><em>b.Variation 2: He- Uniform</em></strong><br><em>All weights will come from the uniform distribution with the below conditions.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*GU4AXtVSz8yKileSEmWtFw.png" /></figure><p>“He” Initialization works fairly well with ReLU &amp; Leaky ReLu.</p><p><strong>Conclusion</strong>:<br>If you guys have any doubts please feel free to comment down below. I hope you guys enjoyed this little interesting journey of weight initialization.</p><p>Connect with me- <a href="https://www.linkedin.com/in/paritosh-kumar-3605a913b/">https://www.linkedin.com/in/paritosh-kumar-3605a913b/</a></p><p><strong>References:<br></strong><a href="https://www.appliedaicourse.com/">https://www.appliedaicourse.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d962ac438bdb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/weights-initialization-in-neural-network-d962ac438bdb">Weights Initialization in Neural Network</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time Complexity of ML Models]]></title>
            <link>https://medium.com/analytics-vidhya/time-complexity-of-ml-models-4ec39fad2770?source=rss-89b61b544de0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ec39fad2770</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Paritosh Kumar]]></dc:creator>
            <pubDate>Sat, 14 Dec 2019 20:57:31 GMT</pubDate>
            <atom:updated>2021-06-26T20:18:46.272Z</atom:updated>
            <content:encoded><![CDATA[<h3>Computational Complexity of ML Models</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*jNQRshlswMmnXO7_TrGvhg.jpeg" /></figure><p><em>If you ever face a scenario like this, Congrats it means you have huge data :D :D.<br>Knowing the Computational complexity is very important in Machine Learning.</em></p><p>So my topic is, <strong>“What are the computational complexities of ML Models”</strong></p><p><strong>Time complexity </strong>can be seen as the measure of how fast or slow an algorithm will perform for the input size. Time complexity is always given with respect to some input size (say n).<br><strong>Space complexity </strong>can be seen as the amount of extra memory you require to execute your algorithm. Like the time complexity, it is also given with respect to some input size (n).</p><p>The complexity of an algorithm/model is often expressed using the <strong>Big O Notation,</strong> which defines an upper bound of an algorithm, it bounds a function only from above.<br>The graph below visualizes different cases of complexities for algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WeSPsmrHYAF8Jy_FS5vldQ.png" /><figcaption><a href="http://bigocheatsheet.com/">http://bigocheatsheet.com/</a></figcaption></figure><p>To write computation complexity we are assuming as,<br> n= number of training examples, d= number of dimensions of the data,<br> k= number of neighbors</p><blockquote><strong><em>The complexity of K Nearest Neighbors to find the k closest neighbor</em></strong></blockquote><p><strong><em>Train Time Complexity</em></strong><em> = O(knd)</em><br>Loops through every training observation and computes the distance <em>d </em>between the training set observation and new observation.</p><p>Time is linear with respect to the number of instances (n) and dimensions (d).</p><p><strong><em>Space Complexity</em></strong><em> = O(nd) </em><br>K Nearest Neighbors store the data.<br>Testing takes longer because you have to compare every test instance to the whole training data.</p><blockquote><strong><em>The complexity of Logistic Regression</em></strong></blockquote><p>Training Time Complexity means in logistic regression, it means solving the optimization problem.<br><strong><em>Train Time Complexity=</em></strong><em>O(nd)</em></p><p><strong><em>Space Complexity</em></strong><em> = O(d)</em><br><strong>Note: </strong>Logistic regression is very good for low latency applications.</p><blockquote><strong><em>The complexity of SVM</em></strong></blockquote><p><strong><em>Training Time Complexity</em></strong>=O(n²)<br>Note: if n is large, avoid using SVM.</p><p><strong><em>Run-time Complexity</em></strong>= O(k*d)<br>K= number of Support Vectors,d=dimentionality of the data</p><blockquote><strong><em>The complexity of Decision Tree</em></strong></blockquote><p><strong><em>Training Time Complexity</em></strong>= O(n*log(n)*d)<br>n= number of points in the Training set<br>d=dimentionality of the data</p><p><strong><em>Run-time Complexity</em></strong>= O(maximum depth of the tree)<br><strong>Note:</strong> We use Decision Tree when we have large data with low dimensionality.</p><blockquote><strong><em>The complexity of Random Forest</em></strong></blockquote><p><strong><em>Training Time Complexity</em></strong>= O(n*log(n)*d*k)<br>k=number of Decision Trees<br>Notes: When we have a large number of data with reasonable features. Then we can use multi-core to parallelize our model to train different Decision Trees.</p><p><strong><em>Run-time Complexity</em></strong>= O(depth of tree* k)<br><strong><em>Space Complexity</em></strong>= O(depth of tree *k)<br>Note: Random Forest is comparatively faster than other algorithms.</p><blockquote><strong>The complexity of Naive Bayes</strong></blockquote><p><strong><em>Training Time Complexity</em></strong> = O(n*d)<br><strong><em>Run-time Complexity </em></strong><em>= </em>O(c*d)<em><br>We have to retrieve feature for each classes ‘c’</em></p><p><strong>Conclusion:<br></strong> If you have a large amount of data , choosing the algorithm is based on the business problem that you are going to solve. Try to reduce the dimension of the data if required to decrease the computation complexities.<br>If you guys have any doubts please feel free to comment down below.<br>Connect with me- <a href="https://www.linkedin.com/in/paritosh-kumar-3605a913b/">https://www.linkedin.com/in/paritosh-kumar-3605a913b/</a></p><p><strong>References :<br></strong> <a href="https://www.appliedaicourse.com/">https://www.appliedaicourse.com/</a><br> <a href="https://stats.stackexchange.com/questions/96995/machine-learning-classifiers-big-o-or-complexity">https://stats.stackexchange.com/questions/96995/machine-learning-classifiers-big-o-or-complexity</a><br><a href="https://imgflip.com/">https://imgflip.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ec39fad2770" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/time-complexity-of-ml-models-4ec39fad2770">Time Complexity of ML Models</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anomaly Detection using lagged based approach algorithm]]></title>
            <link>https://medium.com/analytics-vidhya/anomaly-detection-using-lagged-based-approach-algorithm-d9fd9875d027?source=rss-89b61b544de0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9fd9875d027</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[industry-4-0]]></category>
            <dc:creator><![CDATA[Paritosh Kumar]]></dc:creator>
            <pubDate>Sat, 07 Dec 2019 12:40:06 GMT</pubDate>
            <atom:updated>2021-06-26T20:19:47.920Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ldp_PkfQc1LiJ7_M-OjD0A.jpeg" /></figure><p><em>In this article, I will present a technique that help us to predict the anomaly in the data.</em></p><p><a href="https://en.wikipedia.org/wiki/Anomaly_detection"><strong>Anomaly </strong></a>is an unexpected change within these data patterns, or an event that does not conform to the expected data pattern, is considered an anomaly. In other words, an anomaly is a deviation from business as usual.</p><p><strong>Condition monitoring</strong> (CM) is the process of monitoring a parameter of conditions in machinery (vibration, temperature, etc.), in order to identify a significant change which is indicative of a developing fault.</p><p><strong>Technical Aspects :<br></strong>After understanding the data from the business, We come across a new algorithm. So anomalous behavior for this pattern may tell about the failure.</p><p><strong><em>So the main question comes,” How we can find the future anomaly data”</em></strong></p><p>After doing Exploratory Data Analysis, we come across that 10 parameters are impacting the output variable.</p><p><strong>So for finding the future anomaly data point, I have written one algorithm</strong>.</p><p><strong>Algorithm for finding the future Anomaly :</strong></p><ol><li>In this approach, we will convert our problem into a “Regression Problem”. Then the “output” parameter will become the dependent variable and the other 10 parameters as the independent variable.</li><li>Sort the data set based on timestamps. Convert the timestamps into pandas <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.to_datetime.html">datetime</a> format and sort.</li><li>Take the time lag for each independent variable and calculate the correlation with the dependent variable respectively. Check the code snippet.</li></ol><p>3. Use the above-mentioned code for all the important parameters to find the correlation between the respective “Output” parameter and the lagged independent variable.</p><p><strong>For Example</strong>, Let name the independent variable as “Y” and one dependent variable as X. Let suppose we found that (X-10)the value is highly correlated to current variable “Y”, it means that “Y” is highly correlated with past X-10th value which means for value of “Y” at 10.00 pm is highly correlated with value of “X” at 9.55 pm(10*30 seconds[time gap between data]).</p><p>4. Likewise we can find the lagged based correlation for other parameters also.</p><p>5. Develop a “Regression” based machine learning model with lagged data as an independent variable and “Output” parameter as dependent and deploy the model.</p><p>6. With this approach, we will pass the previous data points to find the “Output” value for the future unseen variable.</p><p>7. Once we have the future data points, we can tell that the data is an anomaly or not using Z-score, IQR etc.</p><p><strong>Conclusion:<br></strong> If you guys have any doubts please feel free to comment down below. I have not gone into too much code for the approach as I don’t want to increase the length of the article I hope you guys enjoyed this little interesting journey of the anomaly detection.</p><p>Connect with me- <a href="https://www.linkedin.com/in/paritosh-kumar-3605a913b/">https://www.linkedin.com/in/paritosh-kumar-3605a913b/</a></p><p><strong>References</strong> :<br> <a href="https://www.appliedaicourse.com/">https://www.appliedaicourse.com/</a><br> <a href="https://towardsdatascience.com/how-to-use-machine-learning-for-anomaly-detection-and-condition-monitoring-6742f82900d7">https://towardsdatascience.com/how-to-use-machine-learning-for-anomaly-detection-and-condition-monitoring-6742f82900d7</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9fd9875d027" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/anomaly-detection-using-lagged-based-approach-algorithm-d9fd9875d027">Anomaly Detection using lagged based approach algorithm</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>