<?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 Navkiran Singh on Medium]]></title>
        <description><![CDATA[Stories by Navkiran Singh on Medium]]></description>
        <link>https://medium.com/@navkiran_singh?source=rss-24c0cd1c74f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Navkiran Singh on Medium</title>
            <link>https://medium.com/@navkiran_singh?source=rss-24c0cd1c74f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 09:20:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@navkiran_singh/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[NLP for Indian Languages]]></title>
            <link>https://medium.com/data-science/nlp-for-indian-languages-310d1d8a10b6?source=rss-24c0cd1c74f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/310d1d8a10b6</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[india]]></category>
            <dc:creator><![CDATA[Navkiran Singh]]></dc:creator>
            <pubDate>Fri, 20 Mar 2020 03:18:50 GMT</pubDate>
            <atom:updated>2023-02-05T05:27:35.906Z</atom:updated>
            <content:encoded><![CDATA[<h4>Join me in exploring the need, the challenges and the tools for natural language processing in the context of Indian vernacular languages</h4><h3>The Need</h3><p>Chances are if you’re reading this article, you have a decent grasp of English. If you’re from India, it’s also likely that English is <em>not the only language you know</em>. Most Indians are multilingual 💬 and study more than one language in school.</p><figure><img alt="A school girl reading a Hindi newspaper and looking up." src="https://cdn-images-1.medium.com/max/1024/0*gfW26pqf3MSSRjnk" /><figcaption>Photo by <a href="https://unsplash.com/@magictype?utm_source=medium&amp;utm_medium=referral">jaikishan patel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>However, can you guess the percentage of English speakers in the country? The answer may surprise you. Give it a go!🏃</p><figure><img alt="Map of India subdivided into regions with most spoken language there." src="https://cdn-images-1.medium.com/max/369/1*HbtkC6oqsXn8vM5gEO1U9w.png" /><figcaption><strong>Figure 1:</strong> Languages by number of native speakers in India. Credit: <a href="https://commons.wikimedia.org/wiki/User:Filpro">Filpro</a>, <a href="https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers_in_India#/media/File:Language_region_maps_of_India.svg">wikipedia</a></figcaption></figure><p><em>The percentage of English speakers in India is…</em><strong><em>just 10% </em></strong><em>[1]. That’s 10% of a one billion-plus population!</em></p><p>Most Indians have Hindi as their first language, followed by Marathi, Telugu, Punjabi, etc. For a lot of people living in rural communities, English is not even a language they understand or speak.</p><p><em>As a side note, for an insight into the demographic profile of English speakers in India, refer [2].</em></p><blockquote>Natural Language Processing, usually shortened as NLP, is an interdisciplinary field that deals with the interaction between computers and humans using the natural language.</blockquote><blockquote>NLP is a way for computers to analyze, understand and derive meaning from human language in a smart and useful way.</blockquote><p>Now that the background of languages in India and purpose of NLP is clear, let’s dig deeper into why this is important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*rbY8VoDYCki8m2wCv75VtA.png" /><figcaption>One might think that people who are acquainted with computers are already familiar with the English interface. However, it’s worth noting that majority of the Indian population in India is still based in rural areas where teaching and learning would be in local languages, where communities are literate, but still are not familiar with English. So, yes, it is a worthwhile effort to upscale NLP research in India. [3]</figcaption></figure><p>The dream of an all-inclusive <strong>Digital India </strong>cannot be realized without bringing <em>NLP research and application</em> in India at par with that of languages like English.</p><p>When engaging with smartphones, <strong>the language barrier can be a huge obstacle to many.</strong></p><p>Take the case of farmers and agriculture which has long been considered the backbone of India. Farmers play an obviously important role in feeding the country. Helping such farmers improve their methods (through precision agriculture, farmer helplines, chatbots, etc) has been an aim of development projects and an important part of the fight against global hunger. But many small farmers are not knowledgeable in English, meaning it is difficult for them to share and learn about new farming practices since most of the information is in English.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FFPWlPtstvu6x4Lw" /><figcaption>Even though our farmer might get the internet access or the tools, he might not understand how to use them if he cannot communicate with them in his native tongue. (Photo by <a href="https://unsplash.com/@nandhukumarndd?utm_source=medium&amp;utm_medium=referral">Nandhu Kumar</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a>.)</figcaption></figure><p><em>Can you imagine a mobile application like Google assistant but tailor-made for Indian farmers? It’d allow them to ask their questions in their native tongue, the system would understand their query and suggest relevant information from around the globe </em>🌏.</p><p><em>Do you think this is possible to do without NLP for Indian regional languages?</em></p><p>And, this is just one possible use-case. From <em>making information more accessible</em><strong> to </strong><em>understanding farmer suicides </em>[4], NLP has a huge role to play.</p><p><strong><em>Thus, there is a clear need to bolster NLP research for Indian languages so that such people who don’t know English can get “online” in the true sense of the word, ask questions, in their mother tongue and get answers.</em></strong></p><p>In fact, people at <a href="https://ai4bharat.org/articles/fonts-for-indian-scripts">AI4Bharat,</a> a platform to accelerate AI innovation in India, summarized the scenario quite aptly:</p><blockquote>Though India is rich in languages, it is poor in resources on these languages.</blockquote><p>The need also becomes clear when we look at some of the applications of NLP in India.</p><h3>The Applications</h3><p>They are:</p><ol><li>Smartphone users in India <a href="https://www.news18.com/news/tech/smartphone-users-in-india-crossed-500-million-in-2019-states-report-2479529.html">crossed 500 million in 2019</a>. Businesses are feeling a need to increase user engagement at the local level. NLP can go a long way in achieving that — by improving search accuracy(Google Assistant now supports multiple Indian Languages), chatbots and virtual agents, etc.</li><li>NLP has huge application in helping people with disabilities — interpretation of sign languages, text to speech, speech to text, etc.</li><li><a href="https://ai4bharat.org/articles/manuscripts">Digitisation of Indian Manuscripts</a> to preserve knowledge contained in them.</li><li><a href="https://ai4bharat.org/articles/sign-board">Signboard Translation from Vernacular Languages</a> to make travel more accessible.</li><li><a href="https://ai4bharat.org/articles/fonts-for-indian-scripts">Fonts for Indian Scripts</a> for improving the impact/readability of advertisements, signboards, presentations, reports, etc.</li></ol><p>There are many more. The ideal scenario would be to have corpora and tools available in as good quality as they are for English to support work in these areas.</p><p>By the way, AI (natural language processing) is increasingly being used for creative tasks like storytelling. There are already <a href="https://nerdynav.com/sudowrite-review/">AI story generators</a> which generate convincing storylines in English. Imagine a day when Indian kids can play with such AI generators to create stories in Indian vernacular languages! Nowadays we can also <a href="https://nerdynav.com/best-ai-voice-generators/">use AI to add voiceovers from text</a> to our videos.</p><h3>The Challenges</h3><p>There are certain problems and issues affecting <em>NLP in general</em> like,</p><ul><li>Ambiguity at different levels — syntactic, semantic, phonological ambiguity, etc.</li><li>Dealing with idioms and metaphors.</li><li>Dealing with emotions.</li><li>Finding referents of <a href="https://en.wikipedia.org/wiki/Anaphora_(linguistics)">anaphora and cataphora</a>.</li><li>Understanding discourse and challenges in <a href="https://www.quora.com/What-is-pragmatic-analysis-in-NLP">pragmatics</a>.</li></ul><p><em>But there are some issues which arise due to differences between English and Indian languages. Thus, they are specific to Indian languages.</em></p><pre>Below an attempt has been made to gather information about work in NLP for specific regional languages. If you feel something is amiss or some work has not been properly credited, contact me via <a href="/service/mailto:singh.navkiran1515@gmail.com">email</a> and I&#39;ll fix it.</pre><h4><strong>Take Hindi as an example. It differs from English in several ways.</strong></h4><p><strong>Some of these differences are:</strong></p><p>1. In sentence structuring, English uses subject-verb-object word order whereas Hindi uses subject-object-verb.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*YR4pgVV4-MFseeHwCTqVZg.png" /><figcaption><strong>Figure 2: SOV </strong>order vs<strong> SVO</strong> order in English.</figcaption></figure><p>2. Presence of post-position case markers instead of prepositions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdK4ACahEOtGW5m0aDOQ-w.png" /><figcaption><strong>Figure 2:</strong> Post-position case markers in Hindi.</figcaption></figure><p>3. Words can be moved freely in many Indian languages without changing the meaning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGrtQ849iqOcZSW4bFSOfw.png" /><figcaption><strong>Figure 3:</strong> Moving words in Hindi sentences.</figcaption></figure><p><strong>Issues in dealing with Hindi:</strong></p><p>1. Scarcity of annotated corpora and tools.</p><p>2. Lack of education and training institutes.</p><p>3. Large set of morphological variants.</p><p>Online resources to learn NLP for Indian languages are limited as compared to English.</p><h4><strong>Some issues specific to Punjabi:</strong></h4><p>1. Large number of morphological variants and word root complexity.</p><p>2. Punjab has different dialects in different regions of Punjab with minor variations. This increases preprocessing work.</p><ul><li><strong>Maajhi </strong>— spoken in Amritsar, Gurdaspur and Tarn-Tarn districts</li><li><strong>Malwai </strong>— Bathinda, Patiala, Firozpur and Moga</li><li><strong>Doabi</strong> — Jalandhar, Hoshiarpur and Nakodar</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*XNwW2MiPyTPmpvktE5zpYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*qNsaNrdHs9k-UkBytu8MqA.png" /><figcaption><strong>Figure 3:</strong> Different Punjabi dialects. (<a href="https://www.quora.com/What-are-some-differences-between-Doabi-and-Majhi-dialects-of-Punjabi">Source</a>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFRAupF_Lee8NKV_tvLiZg.png" /><figcaption><strong>Figure 4:</strong> Example of a few words which differ in Malwai, Doabi and Majha dialect. For details, refer [4].</figcaption></figure><p>3. Hard to look for datasets related to a specific region.</p><p>4. Understanding sarcasm in Punjabi.</p><p>5. Understanding poetry.</p><p>A lot of datasets available at authentic sources like Kaggle, UCI machine learning repository, etc are in English.</p><p>Limited datasets, corpora and other resources are a huge hurdle. There is only one list of stopwords having 184 words in total, released for the public back in 2016. Refer [5] for more details.</p><h4>Some other observations:</h4><p>It’s interesting to note that when I searched for resources for telugu NLP, the top GitHub result I found was <a href="https://github.com/chsasank/telugu-nlp">this</a> and it’s 4 years old at the time of writing with no updates.</p><p>Telugu does have a <a href="https://www.kaggle.com/sudalairajkumar/telugu-nlp">dataset on Kaggle</a>, however. There is also a <a href="https://www.kaggle.com/sudalairajkumar/tamil-nlp">dataset for Tamil</a>. Nonetheless, the discussion and kernels are very few and seemingly haven’t drawn much attention from Indian data science community.</p><h4>A lot of problems are common to all regional languages, like:</h4><ul><li>Lack of datasets/corpora.</li><li>Lack of consolidated efforts.</li><li>Large number of morphological variations.</li><li>Lack of standards.</li></ul><p>Refer [6] for more details.</p><h3><strong>The Tools</strong></h3><p>Some tools I was able to find are listed below with their official descriptions and links to their documentation.</p><pre>My purpose is to include these for completeness. Their documentation is pretty informative and detailed with relevant usage examples. For api usage examples, it&#39;s best to refer to the source documentation, since it will always be up-to-date.</pre><pre>Nonetheless, if more examples are needed, I’ll add them in a future update or a future post. Let me know if there&#39;s any other tool that should be mentioned here.</pre><ol><li><a href="https://github.com/anoopkunchukuttan/indic_nlp_library">Indic NLP Library</a></li></ol><p>From the official description:</p><pre>The goal of the Indic NLP Library is to build Python based libraries for common text processing and Natural Language Processing in Indian languages. Indian languages share a lot of similarity in terms of script, phonology, language syntax, etc. and this library is an attempt to provide a general solution to very commonly required toolsets for Indian language text.</pre><pre>The library provides the following functionalities:</pre><pre>1. Text Normalization<br>2. Script Information<br>3. Tokenization<br>4. Word Segmentation<br>5. Script Conversion<br>6. Romanization<br>7. Indicization<br>8. Transliteration<br>9. Translation</pre><p>Please refer to the <a href="http://anoopkunchukuttan.github.io/indic_nlp_library/">official documentation</a> for api usage and examples.</p><p>2. <a href="https://inltk.readthedocs.io/en/latest/">iNLTK</a></p><pre>iNLTK aims to provide out of the box support for various NLP tasks that an application developer might need.</pre><pre>Supported languages at the time of writing:</pre><pre>1. Hindi  <br>2. Punjabi <br>3. Sanskrit   <br>4. Gujarati   <br>5. Kannada  <br>6. Malayalam   <br>7. Nepali   <br>8. Odia   <br>9. Marathi   <br>10. Bengali   <br>11. Tamil  <br>12. Urdu   <br>13. English </pre><p>Please refer to the <a href="https://inltk.readthedocs.io/en/latest/index.html">official documentation</a> for api usage and examples.</p><p>3. StanfordNLP — Even though I was not able to find a language pack for Indian Languages on Stanford CoreNLP (website <a href="https://stanfordnlp.github.io/CoreNLP/human-languages.html#models-for-other-languages">link</a>), I did find a possible approach to use it for Indian Languages, kindly refer <a href="https://mailman.stanford.edu/pipermail/java-nlp-user/2015-July/007144.html">here</a> . I’ve not tried it personally.</p><h3><strong>The Conclusion</strong></h3><p>The journey of NLP in India seems long and daunting but as the famous proverb goes:</p><blockquote>journeys of a thousand miles begin with a single step!</blockquote><p>Good news is that due to the efforts of hundreds of researchers, industry specialists and students, we have made significant progress in a very short time.<strong> Future of NLP in India seems bright and applications limitless.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I0UbhMThEdMN80xw" /><figcaption>Photo by <a href="https://unsplash.com/@gmalhotra?utm_source=medium&amp;utm_medium=referral">Gayatri Malhotra</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>But again as Robert Frost famously wrote in his poem, ‘Stopping by Woods on a Snowy Evening’, we <em>have miles to go before we sleep.</em></p><h4>References</h4><p>[1] <a href="https://en.wikipedia.org/wiki/Multilingualism_in_India">Multilingualism in India,</a> statistics compiled on Wikipedia from<a href="https://web.archive.org/web/20191113211224/http://www.censusindia.gov.in/2011census/C-17.html"> Indian Census data</a> (2011) among other sources. (Accessed 20 March 2020)</p><p>[2] Rukmini S (2019), <a href="https://www.livemint.com/news/india/in-india-who-speaks-in-english-and-where-1557814101428.html">In India, who speaks in English, and where?</a> , Livemint. (Accessed 20 March 2020)</p><p>[3] Madalli, Devika &amp; Patel, Dimple. (2009). Issues in Indian languages computing in particular reference to search and retrieval in Telugu language. Library Hi Tech. 27. 450–459. 10.1108/07378830910988568.</p><p>[4] Singh, Jaspreet &amp; Singh, Gurvinder &amp; Singh, Rajinder &amp; Singh, Prithvipal. (2018). <a href="https://www.researchgate.net/publication/324299203_Morphological_Evaluation_and_Sentiment_Analysis_of_Punjabi_Text_using_Deep_Learning_Classification">Morphological Evaluation and Sentiment Analysis of Punjabi Text using Deep Learning Classification.</a> Journal of King Saud University — Computer and Information Sciences. 10.1016/j.jksuci.2018.04.003.</p><p>[5] Kaur, Jasleen &amp; Saini, Jatinderkumar. (2016). <a href="https://www.researchgate.net/publication/305997227_Punjabi_Stop_Words_A_Gurmukhi_Shahmukhi_and_Roman_Scripted_Chronicle">Punjabi Stop Words: A Gurmukhi, Shahmukhi and Roman Scripted Chronicle.</a> 32–37. 10.1145/2909067.2909073.</p><p>[6] Kurian, C. and Kannan Balakrishnan, K., 2008. Natural Language Processing in India Prospects and Challenges. In <em>Proceedings of the International Conference on “Recent Trends in Computational Science</em>.</p><p><strong>You reached the end! Thank you for reading and have a great rest of your day. </strong>😄 I hope you found the content useful.</p><p>If you have any feedback 💭 or noticed a mistake, please leave a comment. I’d ❤️to hear your thoughts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=310d1d8a10b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/nlp-for-indian-languages-310d1d8a10b6">NLP for Indian Languages</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to decide between multiple equally good things? Simple, use math!]]></title>
            <link>https://medium.com/analytics-vidhya/how-to-decide-between-multiple-equally-good-things-simple-use-math-7e517f1422d5?source=rss-24c0cd1c74f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e517f1422d5</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[decision-making]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Navkiran Singh]]></dc:creator>
            <pubDate>Fri, 13 Mar 2020 21:44:46 GMT</pubDate>
            <atom:updated>2020-03-20T05:10:52.540Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Learn about TOPSIS for</strong> for Multi Criteria Decision Making + Python Code</h4><p>Were you recently in the market to buy something? Maybe a new phone, a laptop or a TV? Then <strong>you know the more choices we have, the harder it becomes to make a guilt free final choice!</strong></p><figure><img alt="A young women looking confused with a finger on lips and head tilted to the side. A question mark above her head." src="https://cdn-images-1.medium.com/max/640/1*sl-tm-2PgDnwAgN4kLq5bQ.jpeg" /><figcaption>Decision making can be hard.</figcaption></figure><p>Especially when most of the choices seem equally good — a typical scenario when buying smartphones, computers, automobiles, etc. Consider…</p><figure><img alt="Table of choices" src="https://cdn-images-1.medium.com/max/827/1*lZRlsHWuHT-SGc2S_nlGKQ.png" /><figcaption>Do I buy mobile 1? Or do I splurge more and get mobile 3? Mobile 5 has the best camera though! Uhhh!</figcaption></figure><p>The figure shows a typical <strong>multi criteria decision making problem</strong>. Multi criteria because <em>we have more than one criteria differentiating our alternatives</em>. In two choices with few attributes, it’d be an easy binary choice but what to do here?</p><p>Luckily this can be formulated as a mathematical problem and a great thing about mathematical problems is that our computers are excellent at solving them! So let’s get started.</p><h4><strong>Intuition for TOPSIS and its full form</strong></h4><p>TOPSIS stands for <strong>Technique for Order of Preference by Similarity to Ideal Solution. </strong>The full form will become clearer on the basis of the concept so read on.</p><p>It’s basic idea is that the chosen alternative should have the shortest geometric distance from the positive ideal solution and the longest geometric distance from the negative ideal solution.</p><p>In other words, get as close as to the best choice you can and run very far away from the worst choice.</p><p><strong>TOPSIS has the following steps:</strong></p><p><strong>Step 1:</strong> Convert the Looks column to a numerical rating system. We need all columns to be numerical.</p><p><em>The end result will be matrix with m rows and n columns with every cell having numerical values.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*mPFNxaSYMHs5EUvbUP3YZg.png" /><figcaption>Matrix containing m alternatives and n criteria</figcaption></figure><p><strong>Step 2:</strong> Get the normalized matrix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*S1OcRW5lBI2GU9n2vBYyyg.png" /><figcaption>The matrix is normalized using this formula</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*09CKorUASZKEqBePKCyP3Q.png" /><figcaption>Let’s first calculate this denominator for every column</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*TL2SUQHr-xfcPc3Cnfqejg.png" /><figcaption>Last row indicates the calculated denominators</figcaption></figure><p>Next, we divide each cell in a column with the corresponding denominator we just calculated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*7qx9zUzMHEaVpmIpdyyqGA.png" /><figcaption>For example, the value for cell (Mobile1, Price) becomes 250/564.579 i.e 0.4428</figcaption></figure><p><strong>Step 3:</strong> Assign weights to criteria. Get the weighted normalized matrix by multiplying each cell with weight of that column(attribute/criteria).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*CjD_PC5fXSgvPplvHhWUHA.png" /><figcaption>(Mobile1, Price) = 0.4428 * 0.25</figcaption></figure><p><strong>Step 4:</strong> Determining the Ideal Best and Worst.</p><p><em>Each attribute has an impact associated with it. Mark attributes as having </em><strong><em>positive </em></strong><em>impact/beneficial (you want to get more of this) or as</em><strong><em> </em></strong><em>having </em><strong><em>negative </em></strong><em>impact/non-beneficial ( you want to make it less).</em></p><p><strong>Now find Ideal Best and Ideal Worst using the rules below.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*5Q3OmwzgBfjDeDgV5MJbyA.png" /><figcaption>Notation for ideal best</figcaption></figure><ul><li>For <strong>negatives</strong>, ideal best is <strong>Min</strong>(cell values of that attribute)</li><li>For <strong>positives</strong>, ideal best is <strong>Max</strong>(cell values of that attribute)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*rIA6k3l0xt33CI5mwVwdbA.png" /><figcaption>Notation for ideal worst</figcaption></figure><ul><li>For <strong>negatives</strong>, ideal worst is <strong>Max</strong>(cell values of that attribute)</li><li>For <strong>positives</strong>, ideal worst is <strong>Min</strong>(cell values of that attribute)</li></ul><p><em>The rules can be understood intuitively. Price is a negative so ideal best solution will try to minimize it and ideal worst solution will have the maximum price. Camera is a positive so ideal best solution has the best camera — max megapixels and the ideal worst has the minimum megapixels.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*SIbNLseQxT_9x-VSwOXT9g.png" /><figcaption>Note the values in <strong>Ideal Best</strong> and <strong>Ideal Worst</strong> row and verify that they make sense to you</figcaption></figure><p><strong>Step 5: </strong>Calculate<strong> From Best </strong>and<strong> From Worst </strong>values.</p><p><em>From Best is euclidean distance from the best solution and From Worst is euclidean distance from the worst solution.</em></p><p><em>Calculated as follows…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*eCAwXNjcslsSnk8frT_93A.png" /><figcaption><strong>From Best</strong> Calculation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*lXCZXcuqDi6yMjNdhmyN5w.png" /><figcaption><strong>From Worst</strong> Calculation</figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fi58xhIseqtRpC%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fi58xhIseqtRpC%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fi58xhIseqtRpC%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="186" frameborder="0" scrolling="no"><a href="https://medium.com/media/c95ab82ea367d9137d97b93bab0b2f78/href">https://medium.com/media/c95ab82ea367d9137d97b93bab0b2f78/href</a></iframe><p><em>So many calculations! Don’t worry, we can let the computer do all this. After all that is the point of programming — make the computer do the boring stuff! 💻 </em>For now focus on the concepts.</p><p>As an example calculation, consider euclidean distance From Best for mobile 1, it’s calculated as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*LahKXPm6YLsOSBQ82XKL_g.png" /><figcaption><strong>From Best</strong> value for <strong>Mobile 1</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nt7EhyEZaHUVIjiLwZrhRQ.png" /><figcaption>Calculation results of From Best and From Worst</figcaption></figure><p><strong>Step 6:</strong> Calculate <strong>Performance ratio </strong>and use it to <strong>rank </strong>the alternatives<strong>.</strong></p><p><em>Performance ratio can be calculated as follows…</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*TcU-jmsWoHm2I3vDAtEdpw.png" /><figcaption>Notice the numerator — it’s From Worst value. Can you think of a reason why?</figcaption></figure><p>After calculations, we rank the alternatives according to their performance ratios, highest to lowest. This makes sense since higher P implies that a particular alternative is further away from the worst solution (since the numerator is From Worst value). That’s why it’s in the numerator. 💡</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FbG9hIQ7ONi_Dv67PwKNtQ.png" /><figcaption>Performance ratios and ranks. Highest P value has highest rank.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*9LOqp0AJFapx_Vii4-071w.gif" /><figcaption>Coder Kitty 😻</figcaption></figure><p>With this, we are finished with the concept! 🙌</p><p>Onto the code!</p><p><strong>The complete python code for TOPSIS can be found at my </strong><a href="https://github.com/navkiran/TOPSIS-project-navkiran"><strong>github repository</strong></a><strong>.</strong></p><p><a href="https://github.com/navkiran/TOPSIS-project-navkiran">navkiran/TOPSIS-project-navkiran</a></p><p><strong><em>Core logic is in /src/topsis_navkiran.py</em></strong><em> , rest is boilerplate for pypi.</em></p><p><strong><em>I am posting the main parts below with comments.</em></strong></p><p><em>However, please refer to the </em><a href="https://github.com/navkiran/TOPSIS-project-navkiran/blob/master/src/topsis_navkiran.py"><em>github repository</em></a><em> for complete code which can run.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ef87bb74f63f195d47e11ff05ae9086/href">https://medium.com/media/7ef87bb74f63f195d47e11ff05ae9086/href</a></iframe><p><em>Consider forking it and making a pull request, if you find a bug or have an improvement to make.</em></p><p>It’s also available as pypi package <a href="https://pypi.org/project/topsis-navkiran/">here</a>.</p><h3>…and we are done! 🎉</h3><p><strong>Thank you for reading and have a great rest of your day! </strong>😄</p><p>If you have any feedback 💭 or noticed a mistake, please leave a comment. You may also reach me at my <a href="/service/mailto:singh.navkiran1515@gmail.com">email</a> or my personal site <a href="https://navkiran.me/">here</a>. I’d ❤️to hear your thoughts.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F12304800&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fhappy-monsters-motivation-hamster-cute-today-gif-12304800&amp;image=https%3A%2F%2Fmedia.tenor.com%2Fimages%2F2fc97df2ddd928ebec8253e032ebd6d4%2Ftenor.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2da415d6c7c365067dddd20b59589f7/href">https://medium.com/media/a2da415d6c7c365067dddd20b59589f7/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e517f1422d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/how-to-decide-between-multiple-equally-good-things-simple-use-math-7e517f1422d5">How to decide between multiple equally good things? Simple, use math!</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>