<?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 Anmol Singh Sethi on Medium]]></title>
        <description><![CDATA[Stories by Anmol Singh Sethi on Medium]]></description>
        <link>https://medium.com/@reubenrochesingh?source=rss-153e2d1c0588------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-BRB6U6JkIX7GV6nl8h9vg.jpeg</url>
            <title>Stories by Anmol Singh Sethi on Medium</title>
            <link>https://medium.com/@reubenrochesingh?source=rss-153e2d1c0588------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:20:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@reubenrochesingh/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[Don’t Try — The Philosophy of Charles Bukowski]]></title>
            <link>https://reubenrochesingh.medium.com/dont-try-the-philosophy-of-charles-bukowski-bf25d019151d?source=rss-153e2d1c0588------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf25d019151d</guid>
            <dc:creator><![CDATA[Anmol Singh Sethi]]></dc:creator>
            <pubDate>Sat, 10 Apr 2021 12:05:20 GMT</pubDate>
            <atom:updated>2021-04-10T12:07:45.293Z</atom:updated>
            <content:encoded><![CDATA[<h3>Don’t Try — The Philosophy of Charles Bukowski</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*hMY-UsPuSzThnImtHOXrEg.jpeg" /></figure><p>Born in 1920 in Germany and having later migrated to the United States in 1923, Charles Bukowski was a 20th-century German-American writer and a poet known for his unfiltered, potent and often crude takes on life.</p><p>As a German immigrant, Bukowski was condemned and ridiculed for his clothing and accent during his childhood, ostracised as an outcast. Often beaten by his father, the circumstances of abuse and loneliness imposed onto him laid the groundwork for his perspective on life and his desire to express himself as a writer.</p><p>Bukowski tried being a writer all his life, writing thousands and hundreds of stories, most of which often found little to no success. Bukowski worked various blue-collar jobs for several years and he continued writing all those years. Even with no real sight of success or even just creating a living from writing, Bukowski continued writing nearly every day before work for years.</p><p>Bukowski started getting recognition for his writings when he was in his fifties. It was at this time that he started making a living out of writing. On the tail end of a traditional career, at 50 years old Bukowski started his career. He finally became successful as a writer. It took years and years of undying effort and writings to work in his favor so he could gain traction and find success.</p><p>. . .</p><p>It is ironic that his tombstone today reads “<strong>Don’t try</strong>.”</p><p>How could a man who became his idea of himself; a man who, although it took a while found immense respect and recognition for his craft, all because of his relentless trying; how could this man leave the words “<strong>Don’t try</strong>” as his final offering?</p><p>In a letter to his friend William Packard, Bukowski writes-</p><blockquote>“Too many writers write for the wrong reasons. They want to get famous or they want to get rich or they want to get laid by the girls with bluebells in their hair…</blockquote><blockquote>…When everything works best it’s not because you chose writing but because writing chose you. It’s when you’re mad with it, it’s when it’s stuffed in your ears, your nostrils, under your fingernails. It’s when there’s no hope but that…</blockquote><blockquote>…We work too hard. We try too hard.</blockquote><blockquote>Don’t try. Don’t work. It’s there. It’s been looking right at us, aching to kick out of the closed womb.”</blockquote><p>Bukowski implies that if you have to try to try, if you have to try to care about something, to try to want something, perhaps you don’t care about it, perhaps you don’t want it. It’s not that Bukowski didn’t try, he never tried to be something he wasn’t. He tried to be a writer, but he didn’t try to want to be a writer.</p><p>If the pain and endurance of the process of becoming something do not feel worth it and if you are not compelled to do it even in the face of rejection, it is here that Bukowski would say “<strong>Don’t try</strong>”. But if it does, if the thought of not doing it hurts more than suffering through the process, if the thought of life without it, or not having tried it at all terrifies you. If it comes to you, through you, out of you, almost as if you are not trying, perhaps Bukowski might say here, “<strong>Try</strong>” and “<strong>If you are going to try, go all the way.</strong>”</p><p>. . .</p><blockquote><strong>so you want to be a writer?</strong></blockquote><blockquote>if it doesn’t come bursting out of you<br>in spite of everything,<br>don’t do it.<br>unless it comes unasked out of your<br>heart and your mind and your mouth<br>and your gut,<br>don’t do it.<br>if you have to sit for hours<br>staring at your computer screen<br>or hunched over your<br>typewriter<br>searching for words,<br>don’t do it.<br>if you’re doing it for money or<br>fame,<br>don’t do it.<br>if you’re doing it because you want<br>women in your bed,<br>don’t do it.<br>if you have to sit there and<br>rewrite it again and again,<br>don’t do it.<br>if it’s hard work just thinking about doing it,<br>don’t do it.<br>if you’re trying to write like somebody<br>else,<br>forget about it.<br>if you have to wait for it to roar out of<br>you,<br>then wait patiently.<br>if it never does roar out of you,<br>do something else.<br>if you first have to read it to your wife<br>or your girlfriend or your boyfriend<br>or your parents or to anybody at all,<br>you’re not ready.<br>don’t be like so many writers,<br>don’t be like so many thousands of<br>people who call themselves writers,<br>don’t be dull and boring and<br>pretentious, don’t be consumed with self-love.<br>the libraries of the world have<br>yawned themselves to<br>sleep<br>over your kind.<br>don’t add to that.<br>don’t do it.<br>unless it comes out of<br>your soul like a rocket,<br>unless being still would<br>drive you to madness or<br>suicide or murder,<br>don’t do it.<br>unless the sun inside you is<br>burning your gut,<br>don’t do it.<br>when it is truly time,<br>and if you have been chosen,<br>it will do it by<br>itself and it will keep on doing it<br>until you die or it dies in you.<br>there is no other way.<br>and there never was.</blockquote><blockquote>-Charles Bukowski</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf25d019151d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparison of 10 Programming Languages.]]></title>
            <link>https://reubenrochesingh.medium.com/comparison-of-10-programming-languages-f43b0ac337a4?source=rss-153e2d1c0588------2</link>
            <guid isPermaLink="false">https://medium.com/p/f43b0ac337a4</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Anmol Singh Sethi]]></dc:creator>
            <pubDate>Fri, 15 May 2020 05:15:26 GMT</pubDate>
            <atom:updated>2020-05-16T06:56:26.978Z</atom:updated>
            <content:encoded><![CDATA[<p><em>An experiment comparing the speed and runtime of 10 most commonly used programming languages namely, C, C++, C#, Golang, Java, JavaScript, Kotlin, Python, Ruby and Rust.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mpyrgqwMjfclV2oN1U2VIA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@lukechesser?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Luke Chesser</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p><strong>Problem that I experimented with…<br></strong>For this activity I tried solving <a href="https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/">Kids With the Greatest Number of Candies</a> problem present on LeetCode. In this problem we are given with an array candies and an integer extraCandies. We have to find for each kid if there is a way to distribute extraCandies among the kids such that he/she can have the greatest number of candies among them. This particular problem had 103 test cases. You can refer to the problem linked to checkout the input-output files and constraints, and, of-course if you wish to solve this.</p><p>Since I am not very well familiar with all these programming languages, it took a lot of googling the syntax for this comparison. Overall comparisons of these languages:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aE9tYq8HoJP1Hsc8ZM0xBQ.png" /><figcaption>Memory Usage Comparisons</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IH8xzQC_52AE4O3g3T69fg.png" /><figcaption>Runtime Comparisons</figcaption></figure><p>Now, let us delve deeper into the performance of each of these languages and also knowing about them briefly!</p><h4>C</h4><p>C is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, and so on. C programming is an excellent language to learn to program for beginners. Following are the stats when using C</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4LhijO4rDpCtjM69BnLazg.png" /></figure><h4>C++</h4><p>C++ is a powerful general-purpose programming language. It can be used to develop operating systems, browsers, games, and so on. C++ supports different ways of programming like procedural, object-oriented, functional, and so on. This makes C++ powerful as well as flexible. Following are the stats when using C++</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4yC0E90Cvx4Lw3A0HCJFg.png" /></figure><h4>C#</h4><p>C# is a general-purpose, object-oriented programming language. It is one of the most popular languages used for developing desktop and web applications. Being a C based language, C# is closer to C++ and C. Syntactically, it is similar to Java. Following are the stats when using C#</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ItErykGf1PO-Zt4N66LSg.png" /></figure><h4>Golang</h4><p>Golang, is an open source programming language. It’s statically typed and produces compiled machine code binaries. Developers say that Google’s Go language is the C for the twenty-first century when it comes to syntax. However, this new programming language includes tooling that allows you to safely use memory, manage objects, collect garbage etc. Let’s look at the stats</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RJZoA7VDXJz9WlnSFIqm_w.png" /></figure><h4>Java</h4><p>Java is a powerful general-purpose programming language. It is used to develop desktop and mobile applications, big data processing, embedded systems, and so on. According to Oracle, the company that owns Java, Java runs on 3 billion devices worldwide, which makes Java one of the most popular programming languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MNOTNh77nLUCcHmaIXW_kQ.png" /></figure><h4>JavaScript</h4><p>JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xw4cXfnPesSfFF7Mr8j6qQ.png" /></figure><h4>Kotlin</h4><p>Kotlin is a relatively new programming language developed by JetBrains for modern multiplatform applications. Nowadays, Kotlin is widely used for Android development instead of Java. It is because Kotlin is safe, concise, and fun to read and write.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UazybHw9lTv3fP23-7MIgg.png" /></figure><h4>Python</h4><p>Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxLh5EDTcyKfDLgPSN3gMA.png" /></figure><h4>Ruby</h4><p>A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4KisoSvi1JKYWPBEsOngkQ.png" /></figure><h4>Rust</h4><p>Rust is a multi-paradigm programming language focused on performance and safety, especially safe concurrency. Rust is syntactically similar to C++, but provides memory safety without using garbage collection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S4TmERazf-Zp9q-E4NFVgQ.png" /></figure><p>Note that, the test cases against which problems are tested are language specific and also the code that I wrote might not be performing the exact same operations in each of the language variants. Moreover such things are IDE dependent as well. These are just my findings which could be different from yours or the actual values.</p><p>Stay updated for more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f43b0ac337a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Assessment of Forecasting Strategies on Univariate Time Series Data]]></title>
            <link>https://reubenrochesingh.medium.com/assessment-of-forecasting-strategies-on-univariate-time-series-data-b6e89a4588f5?source=rss-153e2d1c0588------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6e89a4588f5</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[time-series-analysis]]></category>
            <category><![CDATA[univariate-analysis]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[time-series-forecasting]]></category>
            <dc:creator><![CDATA[Anmol Singh Sethi]]></dc:creator>
            <pubDate>Wed, 11 Mar 2020 07:22:22 GMT</pubDate>
            <atom:updated>2020-03-11T07:22:22.137Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Report submitted for the semester project in my college.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*S4qUBslI9-Vv7_LXWXEKtw.jpeg" /></figure><h3>Introduction</h3><p>The expansion planning of Power systems begins with a forecast of anticipated load requirement in the coming future. Estimated ideas of the demand and required energy are integral to an effectively planned system[1]. The generation, transmission and distribution system addition capacities are determined by demand forecasts and the kind of facilities required are determined by the energy forecasts[10]. Energy forecasts are further used to monitor and manage the fuel consumption and procurement rates according the current market prices to maintain an adequate rate of return.</p><p>Load forecasting is usually made by the construction of models on relative information such as weather and previous load demand data. Such forecast is majorly reliant for short term load forecasting as long term, such as a month or a year forward would lead to error propagation[2]. In the preceding decades, a number of methodologies for power system load forecasting have been proposed such as ARIMA, AR, MA, ARMA, etc. The idea behind the approach to time series rests on the assumption that a load pattern is just a signal with known timely variations, like daily, weekly, seasonal[5]. These variations aid in presenting a rough estimate of the current load requirement at the given time frame.</p><p>There are broadly four categories of load forecasting vis-a-vis:-</p><ol><li>Very Short term load forecasting</li><li>Short term load forecasting</li><li>Medium term load forecasting</li><li>Long term load forecasting</li></ol><p>Very short term load forecasting is done for a few minutes upto an hour and is majorly used for real time evaluation and security[1]. Short term load forecasting is done for a few hours to a few weeks and is aimed at regulating fuel procurement, short term maintenance scheduling, economic scheduling of required generating capacity. Medium term forecast of upto 5 years ahead are required for transmission system planning, maintenance scheduling, setting of prices, so that demand can be met appropriately. Long term forecasting of upto 20 years is required for regulation policies.</p><h3>Problem Statement</h3><p>We are given the problem of forecasting the future demand requirements<br>of electrical load on the basis of analysis done on some given past data.<br>The requirement to approach the problem is through a non-conventional<br>algorithm namely, Long Short Term Memory(LSTM). Results obtained from<br>some established methods like ARIMA, AR are to be compared with the<br>results obtained from LSTM to give a better view about our designated<br>approach.</p><h3>Literature Survey</h3><p>Nataraja.C et al. did a comparative study on Short Term Load Forecasting Models using the load data for the year 2011 and 2012 for the state of Karnataka[1]. Various models like Auto-regressive Model, Auto-regressive Moving Average, Auto-regressive Integrated Moving Average were compared against each other. The pipeline involved a multi-phase process which included steps for the initial development, the tuning and modification which was followed by the prediction and result gathering phase. The tested models had an error range from 13.03 percent to 6.15 percent. Gao Gao et al. at the Department of Electronic and Electrical Engineering, University of Strathclyde, Glasgow, UK did a comparative study of two different models namely ARIMA and ANN (Artificial Neural Network) on UK electricity market data[2]. The training was done for a data spread over a span of eight weeks in time. The comparison between these models were made on the basis of root mean squared error. The results of this paper show that Autoregressive Integrated Moving averages gives better results in comparison to Artificial Neural Network. The ANN model consisted of twenty neurons. Chikobvu et al. developed a seasonal auto-regressive integrated moving average and predicted daily peak demand of electricity in South Africa from a period of 1996 to 2009[3]. They concluded that SARIMA model produced better results. Nor Hamizah Miswan et al. compared ARIMA with regression model against the benchmark standard models namely ARIMA and regression models to forecast electricity load demand in a Malaysian city[4]. The parameters used for the comparison of the above listed models included root mean square error along with mean squared error. The results were inclined towards the combined method and thus it is a better model. Another research conducted by I. A. Iwok et al. drew out the comparisons between uni-variate and multivariate time series models[5]. A data set from Nigeria’s Gross Domestic Products were used to compare both approaches.</p><p>The parameter to evaluate the performance of these two was mean squared error. The conclusion reported that uni-variate time series analysis which is stationary outperformed the other models. A research by N.A. Abd Jalil et al. focuses on Electrical Load Demand Forecasting using exponential smoothing methods[6]. The dataset used was a half hourly demand of Malaysia for one complete year. For the comparison of forecasting accuracy a parameter called Mean Absolute Percentage Error was used. Various smoothening methodologies were applied namely Holt-Winters Taylor, traditional Holt-Winters etc. V.Venkatesh et al. studied and developed Short Term Load Forecasting Models Using Stochastic Time Series Analysis[7]. They had a dataset for one year which was split into two parts. The first six months were used to train the models and the latter six months were used to test the trained models. Approaches such as AR, ARMA, and ARIMA were developed. Nima Amjady developed a model for Short-Term Hourly Load Forecasting Using Time-Series Modeling with Peak Load Estimation Capability[8]. The main conclusion of this paper was the fact that better results were attained using this particular technique as compared to the traditional Artificial Neural Network Models or the BoxJenkins Model. Hippert et al. in a paper reviewed and evaluated traditional method using neural networks for Short-Term Load Forecasting[9]. Variuos other approaches like using support vector machine for load forecasting for a EUNITE competition[10], using fuzzy neural networks[11], using knowledge based expert systems[12] have been developed or the same analysis. Another approach develops iterative reweighed least squares algorithm for short term power system load forecasting[13]. Another research conducted by Mohamed A. Abu-El-Magd et al. drew a comparison between online and offline methods for short-term electric load forecasting. The load demand was also modelled using multivariate time series analysis [14]. G. T. Heinemann and team studied temperature sensitive and non-temperature sensitive load and did a regression analysis for the same [15].</p><h3>Data Set Description</h3><p><strong>1. Fred Economic Data:- </strong>This data-set is for Industrial Production: Electric and Gas Utilities and is provided by the Federal Reserve System US. It has monthly frequency.The Board of Governers of that system provided the dataset. The data-set contains the date and the demand column.[16]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*-5aKMLRpNFHiY_g5-vsgoA.png" /><figcaption>Fred Data set</figcaption></figure><p><strong>2</strong>. <strong>Open Power System Data:- </strong>This is a time series data-set giving power load data, wind flow data and solar power data consumption, resources, production etc, prices in hourly manner. 6 The data is available for 37 European countries. This data set is provided by Open Knowledge Foundation. Various time series include electricity time consumption or the load, power system modelling etc. Among the many columns, the one used is GB EAW load actual so this column gives the total load for each day in England and Wales.It is published by National Grid. [17]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*1h2LcT_9RvUC6LFseE1CNg.png" /><figcaption>Open Power System Data Data-set</figcaption></figure><p><strong>3. SMARD — Strommarktdsten:- </strong>A data set provided by Federal Network Agency, Germany, contains the electricity market data. This data set was created with the aim of improving transparency. The frequency of the data is daily. The data set contains the value of load for every 15 minutes per day. [18]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*EQNj67hBZOS5rHr5J5apzw.png" /><figcaption>SMARD</figcaption></figure><p><strong>4. Consumption of Household Electric Power Dataset:- </strong>This data set is provided by UC Irvine Machine Learning Repository. The data-set contains 2075259 instances for a single household with a sampling period of one minute which is located in France for a total period of 47 months. Nearly 1.25 percent of the values are missing in the data-set. The data-set contains 9 columns out of which two namely date and global reactive power have been taken in consideration. [19]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*nal34vz1nN8q1wSg01p4zg.png" /><figcaption>Individual household electric power consumptionData Set</figcaption></figure><p><strong>5. Uttar Pradesh State Load Dispatch Data:- </strong>This is a real time data provided by Uttar State Load Dispatch Centre. The website provides real time data for schedule, draw, demand, total SSGS, UP Thermal Generation, deviation rate, etc. The data has been web-scrapped for a period of 1 day. [20]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*zGMjbZVPhSOzRfgaJXeclA.png" /><figcaption>Individual household electric power consumptionData Set</figcaption></figure><h3>Methodology</h3><p>In this section we are going to explain complete steps we followed. The methodology can be represented as the following pipeline:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kPqSGfBPfURWPr8DfUWCig.png" /></figure><p>In the data pre-processing step we first removed the unwanted columns in the data sets we got. Then we removed and edited the unwanted data. we followed different steps for each data set as each of them were in different formats etc. Then we applied the following methods in each of the following section we explained each method what are those, how do they work and then we explained how we used those methods in our project.</p><h4>Auto Regression</h4><p>Regression is a process in which we try to predict one variable with help of one or more other variables. Auto regression is a special type of regression in which prediction of a variable is done with help of the past or previous values of the same variable. For example we can predict the price of gold annually or we can predict the load of electricity over a period of time based on their 10 previous values. Since there can be many other important factors that should be taken into account for example weather in case of electricity load prediction the values might not be absolutely correct but still it makes more sense to find a pattern over a period of time which gives a much stronger prediction.</p><h4>Auto Regression Integrated Moving Averages — ARIMA</h4><p>ARIMA stands for Auto Regressive Integrated Moving Average. It contains two different models AR model and MA model and the I terms is number of times we differentiate the data to make it stationary. AR model is explained before the Model takes previous error residuals into account while predicting. ARMA is combination of AR and MA model. Normally we apply ARMA on stationary data. i.e when the mean and variance of the given data remains constant over a period of time. There are basically two different ARIMA models seasonal and Non-seasonal ARIMA. Both models can be used in different situations like if the data exhibits seasonality then we should use seasonal ARIMA else Non-Seasonal. We represent Seasonal ARIMA as SARIMA. The main difference between ARIMA and SARIMA is SARIMA has more parameters. Normal ARIMA is represented as ARIMA(p, d, q) where as SARIMA is represented as ARIMA(p, d, q)(P, D, Q)m, here (P, D, Q) are for seasonal part of the ARIMA. m is used to represent number of periods that are present in each season. Non seasonal ARIMA doesn’t contain P, D, Q values.</p><h4>Long Short Term Memory — LSTM</h4><p>Long Short Term Memory(LSTM) Networks are a special type of recurrent neural networks, which have been used for various tasks like music completion, handwriting generation among others. They are much more effective to those specific problem areas, than the standard version. RNNs appeal to computer scientists due to their ability to use recent past data to predict the near future characteristics of the system. But, the problem area is when data older than just the immediately previous plays some part in determining the future output. Here, the gap between relevant information and the point where it is needed becomes sufficiently large to be out of the scope of standard RNNs. Theoretically, RNNs can handle such dependencies, but, in practice, they fail to do so.</p><p>LSTMs, on the other hand, are capable of learning long term dependencies. They were introduced by Hochreiter Schmidhuber (1997)[21]. LSTMs were designed to solve the long term dependency problem. By their default behaviour, they remember long term information. LSTMs have a similar chain like structure like RNNs but they differ in the repeating module such that instead of a single neural network layer, they have four.</p><h3>Results</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ofyAQjrfZfxQCKtOpD_5g.png" /></figure><h3>References</h3><p>[1] Nataraja, C. Gorwar, Mahesh Shilpa, G.N. Harsha J, Shri. (2012).<br>Short term load forecasting using time series analysis: A case study<br>for Karnataka, India. International Journal of Engineering Science and<br>Innovative Technology. 1. 45–53.</p><p>[2] Gao, Gao Lo, Kwoklun Fan, Fulin. (2017). Comparison of ARIMA and<br>ANN Models Used in Electricity Price Forecasting for Power Market.<br>Energy and Power Engineering. 09. 120–126. 10.4236/epe.2017.94B015.</p><p>[3] Chikobvu, Delson Sigauke, Caston. (2012). Regression-SARIMA modelling of daily peak electricity demand in South Africa. Journal of Energy<br>in Southern Africa. 23. 23–30. 10.17159/2413–3051/2012/v23i3a3169.</p><p>[4] Miswan, Nor Mohd Said, Rahaini Anuar, S.H.H.. (2016). ARIMA with<br>regression model in modelling electricity load demand. 8. 113–116.</p><p>[5] Iwok, Iberedem Okpe, A. (2016). A Comparative Study between<br>Univariate and Multivariate Linear Stationary Time Series Models. American Journal of Mathematics and Statistics. 2016. 203–212.<br>10.5923/j.ajms.20160605.02.</p><p>[6] Jalil, N.A. Ahmad, Maizah Mohamed, N.. (2013). Electricity load demand forecasting using exponential smoothing methods. World Applied<br>Sciences Journal. 22. 1540–1543. 10.5829/idosi.wasj.2013.22.11.2891.</p><p>[7] “Load Forecasting Bibliography”, Phase I, IEEE Transactions on Power Apparatus and Systems, Vol.PAS-99, №1 January/February 1980.</p><p>[8] Short term load forecasting using time series modeling with peak load estimation capability”, IEEE Transactions on Power Systems, Vol.16, №3 August 2001.</p><p>[9] Hippert, H.s Pedreira, Carlos Souza, Reinaldo. (2001). Neural Networks for Short-Term Load Forecasting: A Review and Evaluation. Power Systems, IEEE Transactions on. 16. 44–55. 10.1109/59.910780.</p><p>[10] “Load forecasting using support vector machines: A study on EUNITE competition 2001”, IEEE Transactions on Power Systems, Vol.19, №4, November 2004.</p><p>[11] “Short term load forecasting using fuzzy neural networks”, IEEE Transactions on Power Systems, Vol.10, №3 August 1995.</p><p>[12] “Short term load forecasting for fast developing utility using knowledgebased expert systems”, IEEE Transactions on Power Systems, Vol.17, №4, May 2002.</p><p>[13] “Short term power system load forecasting using the iteratively reweighed least squares algorithm”, Electric power system research, 19(1990) pp.11–12.</p><p>[14] M. A. Abu-El-Magd and N. K. Sinha, ”Short-Term Load Demand Modeling and Forecasting: A Review,” in IEEE Transactions on Systems, Man, and Cybernetics, vol. 12, no. 3, pp. 370–382, May 1982. doi: 10.1109/TSMC.1982.4308827.</p><p>[15] G. T. Heinemann, D. A. Nordmian and E. C. Plant, ”The Relationship Between Summer Weather and Summer Loads — A Regression Analysis,” in IEEE Transactions on Power Apparatus and Systems, vol. PAS-85, no. 11, pp. 1144–1154, Nov. 1966.</p><p>[16] Board of Governors of the Federal Reserve System (US), Industrial Production: Electric and gas utilities [IPG2211A2N], retrieved from FRED, Federal Reserve Bank of St. Louis; <a href="https://fred.stlouisfed.org/series/IPG2211A2N,">https://fred.stlouisfed.org/series/IPG2211A2N,</a> November 18, 2019.</p><p>[17] ”Open Power System Data. 2019. Data Package Time series. Version 2019–06–05. <a href="https://doi.org/10.25832/time">https://doi.org/10.25832/time</a> series/2019–06–05. (Primary data from various sources, for a complete list see URL).”</p><p>[18] ”SMARD Version 2019–19–11. <a href="https://smard.de,november/">https://smard.de,November</a> 19, 2019”</p><p>[19] Dua, D. and Graff, C. (2019). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science.</p><p>[20] Uttar Pradesh State Load Dispatch Centre. 2019. UP Generation Summary. 2019 Version 11–19–2019. <a href="http://www.upsldc.org/real-timedata/2019-11-19">http://www.upsldc.org/real-timedata/2019-11-19</a> 27.</p><p>[21] Hochreiter, Sepp Schmidhuber, J¨urgen. (1997). Long Short-term Memory. Neural computation. 9. 1735–80. 10.1162/neco.1997.9.8.1735.</p><h3>Co-Authors</h3><ol><li>Sai Charan Teja Tanguturu</li><li>Manavdeep Singh</li></ol><h3>Supervisor</h3><p>Prof. OP Vyas</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6e89a4588f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coroutines in Kotlin]]></title>
            <link>https://reubenrochesingh.medium.com/coroutines-in-kotlin-b7612d428f4a?source=rss-153e2d1c0588------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7612d428f4a</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[kotlin-coroutines]]></category>
            <category><![CDATA[coroutine]]></category>
            <dc:creator><![CDATA[Anmol Singh Sethi]]></dc:creator>
            <pubDate>Mon, 09 Mar 2020 10:34:35 GMT</pubDate>
            <atom:updated>2020-03-09T10:34:35.897Z</atom:updated>
            <content:encoded><![CDATA[<p>With a simple hands-on coding example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*c-dfNp_RM7MLP95LhnAwWA.png" /></figure><p>Coroutines are yet another option for threading in Android. Coroutines finds its use mostly in when background processes need to be executed. These background processes can be network calls(Retrofit or Volley) or calls to access internal SQLite database on the phone(Room persistence library). You can think of coroutines as a Kotlin special feature that convert async callbacks to sequential code. A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously.</p><p>Coroutines are a new way of writing asynchronous, non-blocking code. Threads and coroutines both are used for multitasking but the main difference lies in their management. Threads are managed by the operating system while coroutines are managed by the users. Let us now look at a simple example to understand more about Kotlin coroutines.</p><p><strong>Step 1</strong>: Create a new project in Android Studio and inside the <em>build.gradle</em> <em>(Module: app) </em>include the following dependencies:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*dH0jT5yRqsLWD1BtPtKRWg.png" /><figcaption>Dependencies for Kotlin Coroutines</figcaption></figure><p><strong>Step 2</strong>: Now open the activity_main.xml to add a button and a text field. Upon clicking this button we will execute a function from coroutine and when the function returns we will display a text string in the text field. After adding the palette will look something like this:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncHzyoRS9odNC9YokemMTA.png" /></figure><p>You can find the corresponding xml code in my Github profile, but I highly recommend you to try it as an exercise.</p><p><strong>Step 3</strong>: Now switch to the MainActivity.kt file and add a function which replaces the actual function to get the result from an API or a local db server. Let us name this function as <em>getResult </em>and this should look something like this:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*0jAm7_TVf5ZdGRHezQYGNA.png" /></figure><p>Note:- delay does not block thread. It just suspends the coroutine inside the thread. Moreover, suspend functions are only allowed to be called from a coroutine or another suspend function. Hence, we call this function from the Kotlin coroutine inside the button action listener:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*Jga56Ah4HE0drIlkpBhyQg.png" /></figure><p>Create the function setTextOnScreen to add text on the textView when the coroutines return:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*BRIw2KqgITMAsPQjeB_Ukw.png" /></figure><p>Now, your first Kotlin coroutines application is ready to be run, it should look something like this, when you run it:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*e2BN_eWLPnIk84Vs6Pf0Cw.gif" /></figure><p>You have now created a simple Kotlin Coroutine through this example. You should also refer to the official Kotlin documentation linked <a href="https://kotlinlang.org/docs/tutorials/coroutines/coroutines-basic-jvm.html"><strong>here</strong></a>.</p><blockquote>Clap if you enjoyed this article.<br>Comment if you have something to say.<br>Follow if you want to hear more from me.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7612d428f4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The steward I don’t know]]></title>
            <link>https://reubenrochesingh.medium.com/the-steward-i-dont-know-24f0dfaddf5f?source=rss-153e2d1c0588------2</link>
            <guid isPermaLink="false">https://medium.com/p/24f0dfaddf5f</guid>
            <category><![CDATA[kindness]]></category>
            <category><![CDATA[fiction]]></category>
            <category><![CDATA[old-age]]></category>
            <category><![CDATA[waiter]]></category>
            <dc:creator><![CDATA[Anmol Singh Sethi]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 16:01:13 GMT</pubDate>
            <atom:updated>2020-03-09T11:10:25.470Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*IVGulNv0Z1Qh8O3sx7BwSQ.jpeg" /></figure><p>“Thank you !” said the man, as I passed him the mug kept on my work table in the office. I see this man everyday, looks like he hasn’t taken a leave since a very long time. He is a short heighted and dusky man in his early sixties. The tiredness from the work clearly shows on his worn out face. He often covers his mouth with a mask as a part of the health protocol for stewards in our company.</p><p>He quietly takes the mug from my table and moves further to check other workstations. Slowly he moves out of my vision as he progresses through the cubicles, and I get back to my work of jamming lines of code on my laptop. After everyone is done eating at office, and the cafeteria is empty, I see him along with his co-workers sit and eat food. Occasionally I see him gossiping or cracking a joke with other stewards. Most of the time he is busy cleaning other peoples’ tables or washing utensils in the pantry. I never saw him leave the office during evening. Maybe I leave earlier than him, maybe he leaves earlier than me, who knows? It doesn’t matter.</p><p>I wonder what his life would be once he goes home. I wonder how his home would be. I sometimes then go on thinking about who all would be there in his family. I long to know more about him. I feel he is very content in his personal life because his eyes always seem full of gratitude. As he returns home, his wife and children are waiting for him. I think he has grandchildren too, with whom he plays after going home. I am sure he would be an affable and loving grandfather. Post dinner he would also narrate them tales of superheroes. As he approaches his own bed, the entire days’ fatigue and exhaustion makes him fall asleep instantly.</p><p>Next day, I see him again, cleaning tables in one of the rooms. I have never spoken to him, maybe I never will. I wonder what all I pondered about him would be true or it is far from reality as I slowly progress towards my workstation to start the day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24f0dfaddf5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A dream called Citi]]></title>
            <link>https://reubenrochesingh.medium.com/a-dream-called-citi-5ef9d18d4843?source=rss-153e2d1c0588------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ef9d18d4843</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[citi]]></category>
            <dc:creator><![CDATA[Anmol Singh Sethi]]></dc:creator>
            <pubDate>Mon, 02 Mar 2020 10:20:24 GMT</pubDate>
            <atom:updated>2020-03-05T19:13:59.176Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The chronicles of a summer intern.</em></p><p>After having gone through the rigorous screening process, it was finally the time to join Citi for my 8 week summer internship at Pune. Excitement was at its peak as I boarded the flight from my home town Amritsar to Pune on May 19, 2019. After landing at Pune, I was transported to Westin, Koregaon Park, a hotel which boasted of its excellent hospitality and international cuisine. The Citi office in Pune is located in the Eon IT Park, sprawling over 45 acres of land in the suburbs of Kharadi. With the hustle-bustle of employees entering and exiting the IT park every now and then, the environment feels very lively and energetic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*wGRa0pxES_8uzHSEiwsqgA.jpeg" /><figcaption>Day one at Citi along with the interns selected from my college.</figcaption></figure><p>The on-boarding process for the interns was a bit hectic and it took a couple of days for us to get our systems and everything up and ready. Meanwhile I rapidly started to learn about the role of technology at a company which was primarily a banking firm. Days in and I was assigned the project that I was supposed to work on in the upcoming weeks. I worked on developing a Distributed Automated Test Execution Framework. Although I was pretty familiar with core Java, I was relatively new to the open-sourced Java frameworks such as Spring Boot, Apache Camel, etc. The main problems tackled with the framework were reduction in the speed of test execution along with no need for reinitiating on failure.</p><p>During my time at Citi, I also met other interns, all were from different colleges and different backgrounds but yet everyone had gleamy eyes and undeterred will to prove themselves. I had a very healthy dynamic with my manager and my fellow interns which helped me get a better insight of the work.</p><p>I was diving deeper into the workings of the corporate world, understanding what is expected of an employee along with polishing my professional and technical skills. With everyday passing by, I was getting better at work and my efficiency increased manifold. One of the big lessons I learnt was that there will be days when you won’t be productive, you cannot always stick to the plan. Things will not always go the way you wish them to. It is absolutely alright to fail, but what is more important is what you learn from these failures and how you proceed forward.</p><p>While the weekdays were spent working laboriously on the projects assigned, as Fridays approached we rejoiced ourselves to embrace the upcoming weekend. Not a single weekend we spent lazing around and doing nothing, every weekend was planned with some activity or a short trip somewhere around Pune in the lush, green western ghats. As the monsoon approached we began to experience the freshness of the entire region and the earthly petrichor. I could very well write a travel blog for the trips that I took during this time, but I will try to keep this brief.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*yHqxEzsBVmgsYNml0by-EQ.jpeg" /><figcaption>Getting the much needed vitamin sea @ Alibaug</figcaption></figure><p>While Pune itself is not by the ocean, a short drive from the city landed us in Alibaug for a peaceful and a serene trip. As we lay on the sand bed watching the sun set over the vastness of the ocean, all the tiredness from work wore away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*tP3A47lN_XAYMTDvlQxBtg.jpeg" /><figcaption>Our rented cottage at Lonavla.</figcaption></figure><p>Lonavla was yet another milestone trip for us. We had rented an Airbnb in the foothills of Sahyadris by a lakeside. Our tiny little cottage was surrounded with lush green valleys and blooming meadows. During evening we visited the sumptuous Pawna lake, with its crystal clear appearance. This was not a very touristy place so, except us, no one was there. We played cards by the lakeside and enjoyed the freshness of the dew drops falling from the leaves. I also visited Bombay during one of the weekends to meet my relatives. I was dreaded by the Mumbai Monsoon, but luckily everything went fine and I managed to visit the well known, Taj Mahal Hotel and the Marine Drive.</p><p>Everything was hunky-dory until we realised that we were approaching the end of this intern season. The nerve-wrecking presentations awaited us. While it was not a herculean task to present the project my team had worked on, it was tough to reconcile to the fact that this dream was getting over. I would no longer be able to see the faces of my teammates. The ones who made living in a new city feel like home would be separated and who knew when I could meet them again. With the ticking of the clock, my fondness for my new found friends increased. All of us relied on each other for emotional support, which none of us wanted to end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*zofItKeofkHQGmkKAnL3wg.jpeg" /><figcaption>The Gang</figcaption></figure><p>All the bad things in life come to an end, but so do the good things. How much ever you want something to continue, you are made brace the blunt reality. The last few days of the internship were spent cherishing the absolute bliss that this internship was. At this stage of my career where the foundation is being established, Citi has helped me strengthen the roots, so that I can soar and achieve everything that I dream of. I took back with me the best of work ethics, the infinite learnings, but more than anything, I felt fulfilled and a sense of achievement made me proud of myself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*jApeUw1oO6QMSLraidDqhQ.jpeg" /><figcaption>Last Day @ Citi</figcaption></figure><p>It has been seven months since the internship ended. Now, I am sitting on a different workstation in a different company in a new city with new peers doing my second internship which is again starting to feel like a dream that I never want to end. Time flies by and it seems like it was yesterday when I appeared for the interview with Citi. Though the time has progressed long enough, but the memories of everything are still so fresh. I can still feel the dew drops on the leaves in Lonavla, I can still feel the water rubbing against my feet in Alibaug, I can still see the kaali-peel taxis moving around in Bombay and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*tpZkY2y7eHOc-kZIkzdS6A.jpeg" /><figcaption>The Interns of Equities and Cash Business Unit.</figcaption></figure><p>Thank you Citi.</p><p>#SummerAtCiti</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ef9d18d4843" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interview with Citi]]></title>
            <link>https://reubenrochesingh.medium.com/interview-with-citi-380613c0b591?source=rss-153e2d1c0588------2</link>
            <guid isPermaLink="false">https://medium.com/p/380613c0b591</guid>
            <category><![CDATA[citi]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[internships]]></category>
            <dc:creator><![CDATA[Anmol Singh Sethi]]></dc:creator>
            <pubDate>Sun, 25 Aug 2019 09:55:57 GMT</pubDate>
            <atom:updated>2020-03-02T07:03:21.512Z</atom:updated>
            <content:encoded><![CDATA[<p>The intern interview saga</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TSxKmj4io8L9yEVcOxrcxg.jpeg" /></figure><p>Companies visit our campus during the months of June-July to hire interns to work during the following summers. Citi Corp visited our campus on 18th August 2018, Saturday. I was hoping to get selected in this company and had been dreaming to get into it since the start of my preparation for the internship season.</p><p>An online test was conducted on 17th August. The duration for the online test was 2.5 hours. The online test had 4 sections.</p><p>A brief description of each of them:-</p><p>1. Section 1: Technical Knowledge- It contained questions on C/C++, Java, time complexities, sorting, etc. All the questions were multiple choice for the first three sections.</p><p>2. Section 2: Quantitative Aptitude- It contained questions on profit/loss, pipes/cisterns mental ability and basic maths.</p><p>3. Section 3: English- It contained synonyms, antonyms, comprehension, sentence reordering.</p><p>It was followed by 2 coding questions. The questions were matrix chain multiplication and a sub tree checking problem.</p><p>Approximately 150 students sat for the online test, and 42 were shortlisted for the second round.</p><p>Interview: There was a panel of 7 people which was conducting the interviews. My turn came at the end.</p><p>Round 1: Technical Interview.</p><p>The interviewer asked me for my resume. I handed him over my resume. Then he asked me to brief him about my resume. I gave him a brief introduction about myself, my family background, my interests in public speaking and debating. Then I asked him if I should tell him about my projects. On his replying positively, I explained him first about Emotify, a project built during the hackathon. I explained him in detail about the project and the technologies used. Then he gave me certain scenarios and asked me how my algorithms would handle those cases. I explained each one of them with confidence. Then I told him about the course projects we had done. He listened to each of them carefully.</p><p>He then asked me which languages I am fluent in, to which I replied C/C++. He asked me the differences between both of them. I listed out all the differences. Among those points one point was related to object oriented methodologies. So, he wanted me to explain him the features of OOM. I explained him what abstraction, polymorphism, encapsulation, overloading meant. He then asked me about access specifiers, I explained them as well. He wrote a few excerpts of code on paper and asked what would be the output. Then he asked me a puzzle, given 25 horses and 5 tracks how many minimum races are required to find the fastest horse. I knew the answer was 7, but didn’t say right away. I tried a wrong approach a few times with confidence to get to an answer. He seemed impressed about the fact that I was trying. Later, he asked me if there was anything I wanted to ask, so, I asked him about my role in the company. He explained in detail about it. We shook hands and the interview ended on a positive note.</p><p>Out of 42, only 14 were shortlisted for the second round.</p><p>Round 2: HR Interview</p><p>There were two panellists sitting to interview me. I was the last candidate. I entered the room and greeted them. They already had a copy of my resume. One of the panellists asked me to introduce myself. I again told everything about myself, for them to know me better. The introduction went on for 5–6 minutes. He then asked me to explain my role in the various projects I had done. Then he asked me about the qualities I have and others don’t. He then asked what leadership meant to me. He also asked about my role model and the reasons behind my answer. He asked me why Citi and why was I interested to join a fin-tech company. He also asked me if I wanted to give them any suggestion regarding the pre-placement talk.</p><p>After all this, he asked me if I had any questions for him. I asked two questions to show them that I was really interested in working at Citi.</p><p>Out of 14 shortlisted, 7(4 girls and 3 boys) were finally selected. I was one among them. The whole team of Citi then congratulated us and took a photo will all the selected interns.</p><p><a href="https://anmolsinghsethi.wixsite.com/homepage/blog/search/.hash.summeratciti">#SummerAtCiti</a></p><p>P.S. I will soon write about my internship experience at Citi. Stay tuned to get an insight into the same.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=380613c0b591" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Face Detector Using Principal Component Analysis (PCA) From Scratch in Python]]></title>
            <link>https://reubenrochesingh.medium.com/building-face-detector-using-principal-component-analysis-pca-from-scratch-in-python-1e57369b8fc5?source=rss-153e2d1c0588------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e57369b8fc5</guid>
            <dc:creator><![CDATA[Anmol Singh Sethi]]></dc:creator>
            <pubDate>Sun, 07 Apr 2019 18:36:38 GMT</pubDate>
            <atom:updated>2020-04-04T08:49:31.695Z</atom:updated>
            <content:encoded><![CDATA[<h4>Hands on coding from scratch without using inbuilt libraries.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nMvCDCWwNa7PZTJWLfNrrw.jpeg" /><figcaption>Image Credits: Pixabay</figcaption></figure><h3>Introduction</h3><p>PCA or the Principal Component Analysis is a technique that is used for data reduction. The data is compressed in a way such that the main features of the data are preserved. Consider an image of size mXn, where each pixel is a feature for the image. However, not all the features are facial features. With the help of PCA, we extract the facial features, thus, reducing the dimensions. This article focuses more on building the face detector, rather than understanding the underlying concepts of using PCA for Face Detection. To know more about the theoretical concepts, read <a href="https://medium.com/u/a9299d72f9c3">Muyi Tao</a>’s medium post on the same here, <a href="https://medium.com/@monicatmy777/face-recognition-using-pca-b15e934b5b64">https://medium.com/@monicatmy777/face-recognition-using-pca-b15e934b5b64</a></p><h3>Step 1: Create a database of images</h3><p>Collect approximately 6 pictures of 8–9 people via the camera of your mobile phone or through the internet. All the images must of the same size (I am using all images to be of 720X1280 pixels). Once your database is ready, read all the images using the cv2 library and create a face vector with dimensions <em>total pixels in one image</em> X <em>total images. </em>The following code will do the same:</p><pre>face_vector = []</pre><pre>for i in range(total_images):<br>    face_image = cv2.cvtColor(cv2.imread(path), cv2.COLOR_RGB2GRAY)<br>    face_image = face_image.reshape(total_pixels,)<br>    face_vector.append(face_image)</pre><pre>face_vector = np.asarray(face_vector)<br>face_vector = face_vector.transpose()</pre><h3>Step 2: Normalising the Face Vectors</h3><p>Once the face_vector is formed, we need to calculate the mean image of all the images and subtract it. This being done because we need to eliminate the features that are common to all the images.</p><pre>avg_face_vector = face_vector.mean(axis=1)<br>avg_face_vector = avg_face_vector.reshape(face_vector.shape[0], 1)<br>normalized_face_vector = face_vector - avg_face_vector</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/172/1*EJLn7hAWPBLoopI9cP85Cw.png" /><figcaption>Average Image</figcaption></figure><h3>Step 3: Calculate the Co-variance Matrix</h3><p>A co-variance is a <a href="https://en.wikipedia.org/wiki/Matrix_(mathematics)">matrix</a> whose element in the <em>i</em>, <em>j</em> position is the co-variance between the <em>i</em>-th and <em>j</em>-th elements of a <a href="https://en.wikipedia.org/wiki/Random_vector">random vector</a>.</p><pre>covariance_matrix = np.cov(np.transpose(normalized_face_vector))</pre><h3>Step 4: Calculate the Eigen Values and Eigen Vectors</h3><p>Eigenvalues are a special set of scalars associated with a <a href="http://mathworld.wolfram.com/LinearSystemofEquations.html">linear system of equations</a> (i.e., a <a href="http://mathworld.wolfram.com/MatrixEquation.html">matrix equation</a>) that are sometimes also known as characteristic roots, characteristic values (Hoffman and Kunze 1971), proper values, or latent roots (Marcus and Minc 1988, p. 144). They can be calculated using inbuilt function.</p><pre>eigen_values, eigen_vectors = np.linalg.eig(covariance_matrix)</pre><h3>Step 5: Select K-Best Eigen Vectors</h3><p>The eigen vectors are sorted based on their eigen values, and the K-Best among them are chosen.</p><pre>eigen_vectors = sort(eigen_vectors)<br>k_eigen_vectors = eigen_vectors[0:k, :]</pre><h3>Step 6: Convert Lower Dimensional K Eigen Vectors to Original Dimensional</h3><p>This step can be performed by multiplying the K-best eigen vectors with the transpose of normalized face vector.</p><pre>eigen_faces = k_eigen_vectors.dot(normalized_face_vector.T)</pre><h3>Step 7: Represent Each Eigen Face as combination of the K-Eigen Vectors</h3><p>We now need to find the weights by multiplying eigen faces with normalized face vectors.</p><pre>weights = (normalized_face_vector.T).dot(eigen_faces.T)</pre><p>This step completes our Training Part.</p><h3>Step 8: Testing</h3><ol><li>Convert input test image into face vector.</li></ol><pre>test_img = test_img.reshape(total_pixels, 1)</pre><p>2. Normalize the face vector.</p><pre>test_normalized_face_vector = test_img - avg_face_vector</pre><p>3. Projecction of the vector onto eigen space.</p><pre>test_weight = (test_normalized_face_vector.T).dot(eigen_faces.T)</pre><p>4. Calculate the index for which the distance is minimum.</p><pre>index =  np.argmin(np.linalg.norm(test_weight - weights, axis=1))</pre><p>The index belongs to the subject with whom the testing picture matches the most. This completes our Testing Part.</p><p>The images which are captured in the same lighting conditions are detected very well, however the algorithm fails to identify the images with the different lighting conditions and increase in the background noise. There is another algorithm called Linear Discriminant Analysis or the LDA, which does a slightly better job for the same. We shall build Face Detector using LDA in the next post.</p><p>Stay tuned!</p><p><strong>Update: </strong>Link to the source code <a href="https://medium.com/@reubenrochesingh/rabhi-thanks-for-liking-the-post-cc3e1564546f?source=responses---------1-----------------------">https://github.com/xanmolx/FaceDetectorUsingPCA/blob/master/PCA_Face_Recognition_IIT2016040.ipynb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e57369b8fc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>