<?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 Arya Mohapatra on Medium]]></title>
        <description><![CDATA[Stories by Arya Mohapatra on Medium]]></description>
        <link>https://medium.com/@aryamohapatra?source=rss-433f123f9ecd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*95VQUkiTexja1KNWx0bcGQ.png</url>
            <title>Stories by Arya Mohapatra on Medium</title>
            <link>https://medium.com/@aryamohapatra?source=rss-433f123f9ecd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:54:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aryamohapatra/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[Data Science in CreditRisk Series Topic 1 : Basics of Credit Risk]]></title>
            <link>https://medium.com/@aryamohapatra/data-science-in-creditrisk-series-topic-1-basics-of-credit-risk-95af5378cd48?source=rss-433f123f9ecd------2</link>
            <guid isPermaLink="false">https://medium.com/p/95af5378cd48</guid>
            <dc:creator><![CDATA[Arya Mohapatra]]></dc:creator>
            <pubDate>Fri, 07 Jun 2024 00:05:37 GMT</pubDate>
            <atom:updated>2024-06-07T00:08:33.782Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Science in CreditRisk Series Topic 1 : Basics of Credit Risk</h3><p>Credit risk is a critical concept in the world of finance, impacting banks, investors, and businesses alike. It essentially measures the risk of a borrower defaulting on their financial obligations. Understanding credit risk is essential for anyone involved in lending, investing, or managing financial institutions. This post will break down the basics of credit risk, its components, and its management.</p><p><strong><em>What is Credit Risk?</em></strong></p><p>Credit risk, also known as default risk, refers to the possibility that a borrower will fail to meet their debt obligations, resulting in a financial loss for the lender. This risk is inherent in all forms of lending and can affect loans, bonds, and other financial instruments.</p><p><strong><em>Key Components of Credit Risk</em></strong></p><p><strong>1. Probability of Default (PD):<br></strong> — The likelihood that a borrower will default on their debt. This probability is influenced by various factors, including the borrower’s credit history, financial health, and economic conditions.</p><p><strong>2. Loss Given Default (LGD):<br></strong> — The amount of loss a lender incurs when a borrower defaults, expressed as a percentage of total exposure. LGD is influenced by factors such as collateral, the seniority of the debt, and recovery rates.</p><p><strong>3. Exposure at Default (EAD):<br></strong> — The total value exposed to default at the time of default. This includes the loan principal, interest due, and any other associated costs.</p><p><strong>4. Maturity:<br></strong> — The time horizon over which the credit risk is assessed. Longer maturities generally carry higher credit risk due to increased uncertainty over time.</p><p><strong><em>Factors Influencing Credit Risk</em></strong></p><p>Several factors can influence the level of credit risk associated with a borrower:</p><p>- Credit History: A borrower’s past behavior in repaying debts.<br>- Financial Stability: The financial health of the borrower, including income, assets, and liabilities.<br>- Economic Conditions: Macro-economic factors such as recession, inflation, and interest rates.<br>- Industry Risks: Specific risks related to the borrower’s industry.<br>- Regulatory Environment: Legal and regulatory factors that could affect the borrower’s ability to repay.</p><p><strong><em>Managing Credit Risk</em></strong></p><p>Effective credit risk management is crucial for the stability and profitability of financial institutions. Here are some common strategies used:</p><p>1. Credit Scoring Models:<br> — Utilizing statistical models to evaluate the creditworthiness of borrowers. These models consider factors such as credit history, income, and debt levels.</p><p>2. Diversification:<br> — Spreading risk across a wide range of borrowers, industries, and geographic regions to mitigate the impact of any single default.</p><p>3. Collateral and Guarantees:<br> — Securing loans with assets or third-party guarantees to reduce potential losses in the event of default.</p><p>4. Credit Derivatives:<br> — Financial instruments such as credit default swaps (CDS) that transfer credit risk to other parties.</p><p>5. Regular Monitoring:<br> — Continuously monitoring the credit risk profile of borrowers to identify any changes in risk and take corrective actions.</p><p>6. Stress Testing:<br> — Conducting simulations to assess the impact of adverse economic scenarios on the credit portfolio.</p><p><strong><em>Conclusion</em></strong></p><p>Credit risk is an inherent aspect of the financial system, affecting lenders, investors, and businesses. Understanding its components and factors is essential for effective risk management. By employing strategies such as credit scoring, diversification, and regular monitoring, financial institutions can mitigate credit risk and maintain stability in their operations.</p><p>Whether you are a finance professional or an investor, a solid grasp of credit risk principles will enable you to make more informed decisions and contribute to a more resilient financial system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95af5378cd48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Target Encoding : Create some relation between Target Variable and the Encoded Labels !!]]></title>
            <link>https://medium.com/@aryamohapatra/target-encoding-create-some-relation-between-target-variable-and-the-encoded-labels-2ed0d172fceb?source=rss-433f123f9ecd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ed0d172fceb</guid>
            <category><![CDATA[decision-tree]]></category>
            <category><![CDATA[encoding]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[target-encoding]]></category>
            <dc:creator><![CDATA[Arya Mohapatra]]></dc:creator>
            <pubDate>Mon, 27 Dec 2021 00:01:12 GMT</pubDate>
            <atom:updated>2022-01-05T22:10:39.438Z</atom:updated>
            <content:encoded><![CDATA[<h3>Target Encoding : Create some relation between Target Variable and the Encoded Labels !!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MGXQDmKNmwdRMTh-MVGaJA.png" /><figcaption>Source: Google Images</figcaption></figure><p>Are you fed up with One-Hot encoder and Label Encoding ? (Just kidding :P They are great !! :) ) But Let us park our favourite encoding methods for some time and we will learn some new techniques today for labelling our data.</p><p>We will try to understand few things here.</p><ol><li>What is Target Encoding</li><li>Different Strategies for target encoding</li><li>For a Dataset will check the effect of LabelEncoding and TargetMeanEncoding</li><li>Find its Advantages</li><li>Know when to avoid this</li></ol><p>I think this would give you a sense of this technique. Let’s start. Wait did I tell you this technique has been very famous with Kagglers :P</p><h3><strong>What is Target Encoding:</strong></h3><p>Let’s review what encoding is because I assume you already know what it is. When a column contains categorical variables, such as “Red, Yellow, Blue” or “Male, Female” or “Cat, Dog,” we must give each categorical value to a numerical value, which is referred to as encoding.Clearly, there are several methods for assigning a numerical value to categorical variables, the most common of which being Label Encoding and One Hot Encoding.</p><p>Now, Target encoding involves creating a relationship between the Target variable and the encoded label, which implies that anytime we assign integers as part of the encoding, we must consider the Target variable. I realise this seems a little perplexing, but that’s why we’re here :)</p><p>Let’s have a look at an illustration. We’ll take a look at two scenarios. When the goal is discrete (i.e., a classification problem) and when the target is continuous (i.e., a regression problem).</p><h4>When Target is Discrete:</h4><p>Let’s take a data set like below. We have a column called <em>Weather</em> which has</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9I1XP1A5hiRC68BkkvnkWQ.jpeg" /><figcaption>Figure 1 : Target Encoding When Target is Discrete</figcaption></figure><p>values named ‘Rainy’, ‘Sunny’ and ‘Windy’ and we have a Target column called ‘Play ? ’ referring if a person will go out to play considering the weather.</p><p>Now if we encode the <em>Weather</em> column randomly then we can encode it anyway. Here we have given Rainy as 1, Sunny as 2, Windy as 3. But if you see the derived right table We have encoded Rainy as 0.33, Sunny as 0.75, Windy as 0.5. How have we come to this value. Ok So here we have taken the Target column into consideration to find out the values. How ? Let’s see.</p><p>Consider the value ‘Rainy’. It appears 3 times in the column and out of that 1 time it has the yielded the target value as 1. So the probability of Target being 1 given <em>Weather</em> as ‘Rainy’ is 1/3 (0.33) hence we have encoded ‘Rainy’ as 0.33. Similarly ‘Sunny’ appears 4 times and 3 times it yielded 1 as Target so the encoded value becomes 3/4 = 0.75. Same goes with ‘Windy’. So this is how we Target encoded the Weather column keeping the target variable in mind.</p><h4>When Target is Continuous:</h4><p>Now let’s understand if the Target variable is continuous in nature how can we can encode them. Below image gives you a good explanation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BTxRrw9Z00MkDoCwrA3BJA.jpeg" /><figcaption>Figure 2 : Target Encoding When Target is Continuous</figcaption></figure><p>So as you can see while doing the target encoding first we calculated the mean mileage of each car segment. Then sorted them in descending order. Now the idea is to assign a higher encoding number to the Car Segment having higher mean, which is what we have done as Maruti has highest mean we assigned it 3 and subsequently Honda as 2 and Skoda as 1. So this is how we perform Target Encoding considering the Target variable in the process.</p><p>Here you can exercise your Analytical mind to encode the numbers. You can consider a range of value to choose a Encoding number. This will help you you to even reduce the cardinality of the column. For example in the above table I will say if the Mean is between 10 to 20 I will label it as 2. In that case Both Honda and Skoda becomes 2. Hope you get it :)</p><h4>Now when do we do this ?</h4><ol><li>When we have column with hight cardinality ( Significant categorical variables in a column to encode) target mean encoding can be a blessing.</li><li>When we have to establish a relationship between target and the particular column which will make sense in our task, this method helps.</li><li>While working with tree based models. This works the best as the data is supplemented with additional information on the structure of encoded values of the category feature.</li></ol><h4>Sshhh..!! It also has some drawbacks</h4><p>The Batman story would be incomplete without the Joker. Here the Joker is <strong><em>Overfitting</em></strong>.</p><p>As this method uses the target information while encoding and with the help of that it trains the model it leads to Target leakage. As the label encoding information can be different while training the data and new incoming prediction data, the model leads to overfitting and that would lead to unreliable validation and lower test scores.</p><p>Be very vigilant about this while working on this encoding method. There are multiple methods to overcome the same. This [<a href="https://www.kaggle.com/vprokopev/mean-likelihood-encodings-a-comprehensive-study">Linked</a>] article would be a great read to know more about applying regulariztion.</p><p>I hope you learnt something new today. Happy learning till we meet again :) :)</p><p>References:</p><p>[1]:<a href="https://www.kaggle.com/vprokopev/mean-likelihood-encodings-a-comprehensive-study">https://www.kaggle.com/vprokopev/mean-likelihood-encodings-a-comprehensive-study</a></p><p>[2]: <a href="https://www.linkedin.com/pulse/encode-categorical-features-revanth-yadama/">https://www.linkedin.com/pulse/encode-categorical-features-revanth-yadama/</a></p><p>[3]: <a href="https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/target-encoding.html">https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/target-encoding.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ed0d172fceb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The matter of human replacement by Artificial Intelligence : Still a rhetorical question.]]></title>
            <link>https://medium.com/@aryamohapatra/the-matter-of-human-replacement-by-artificial-intelligence-still-a-rhetorical-question-aeff6ec48331?source=rss-433f123f9ecd------2</link>
            <guid isPermaLink="false">https://medium.com/p/aeff6ec48331</guid>
            <category><![CDATA[industry-4-0]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Arya Mohapatra]]></dc:creator>
            <pubDate>Sat, 01 Aug 2020 22:05:37 GMT</pubDate>
            <atom:updated>2020-08-02T16:24:52.198Z</atom:updated>
            <content:encoded><![CDATA[<h3>The matter of human replacement by Artificial Intelligence : Still a r<strong>hetorical question.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*BsvmkANGM64HhLk90-O4Jg.jpeg" /></figure><p>Technology’s extravagance is rising day by day. No one can deny the fact that today’s vast volume of data and state-of-the-art technologies are changing the existing environment by enabling individuals and organizations to simplify and improve existing processes in an unprecedented way. But the innovations come with its own repercussions. One of the singular fears of the advancements as raised by some commentators is the technological unemployment. This has been seen in many of the sectors like investment banks, law and accounting firms, hospitals and corporations where day to day manual and routine jobs are being replaced by automations. Technological advancements are inevitable. This is not something new that we are experiencing.</p><p>Realization of the benefits in the arc of technological advances often has given the path for accelerating the automation and adopting digital inventions throughout the economy. Fruitful examples are the Industrial revolutions we have experienced decade after decade. But the principle point of dialogue could be, to what volume the power of Artificial Intelligence may be maneuvered. In near future will the Automation result in a continuous redistribution of labor or it will result in a sudden and rapid job cessation? Let us discuss the advantages of the usage of Artificial intelligence in our labor market in conjunction with the effects and consequences with the good-sized adoption of automation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*eOn65R7fnDhJzHq5bgIwtQ.png" /><figcaption><a href="https://www.opc-router.com/way-industry10-to-industry40/">Source</a></figcaption></figure><p>As humans, we remain in constant fear that any new technological advances may dominate our talent one day. No doubt innovations have been rigorously transforming our life in a better way by rendering advanced living standards but then parallelly it is sneaking into the vicinity of human’s capabilities for doing certain jobs. Why AI has been a buzz? If we need to understand AI, this is an area of computer science where we empower machines to acquire human intelligence by acting and reacting like humans. And with each passing day when we are significantly closing the gap between machines and humans, their implementations are affecting our social ecosystems. It directly impacts the working conditions and employment. And this is the most immediate concern for everyone that AI-enabled systems might replace the laborers across various range of industries.</p><h3>The Shifts and An Example</h3><p>Artificial Intelligence is growing considerably with each passing second and we will see many more shifts in technology in years ahead and affect different industries. For example, there are self-driving cars being tested and being rolled out in the market, there are automated vending machines, there are drones delivering shipments, there are automated machineries for assembling products and the list goes on. Every segment of our economy is being taken by the automation and is benefited from this. An area which has been slowly adopting the convenience of Artificial Intelligence is the Healthcare Industry. It is witnessing human intelligence being replaced by artificial intelligence. Human Intelligence is an outcome of continuous learning over the years with the cognitive ability to respond to circumstances, adapt to new environments and holds the power to handle complicated task. As we recreate the human Intelligence with the help of AI, this becomes the tool to tailor the exact way human handles the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*521QkolIMwQkfYCDfzdBPw.png" /></figure><p>Starting with a simple problem which AI is certainly solving is the management of health records. With the help of AI, variety of data which comes in many forms and many sizes are easily being interpreted proactively and strategically saved with sensible patterns which would have been a tedious manual work. Medical professionals are uncovering the hidden dynamics, movements and associations with the aid of AI and machine learning. To focus on some of the significant achievements in medical industry, we cannot skip mentioning when in 2017 A robot passed a medical Licensing Exam in china.[1]. This machine can automatically capture and analyzes the patient’s information and help with the initial diagnosis which can used in future treatment. In another scenario where a robot performed an hour-long dental implant operation successfully under supervision of human dentists [2]. Again, a significant advancement has been done where AI is helping to detect Melanoma a kind of Cancer which is notably difficult to detect with human eye.</p><h3>Consequences and Numbers</h3><p>We can draw a sense of better transformation of the scenarios by using AI, looking at the above examples. No doubt we are being highly benefited from the usage of automation and Artificial Intelligence. Be it in any domain. But in conjunction with the benefits these automations and machines adapting human behavior are causing a definite gap between humans and employment. When a machine involves in data management people loose their jobs there, When a machine starts medical operation a human doctor loses his/her job there, When a machine diagnoses any fatal problems , along with giving benefits to the consumer, it’s affecting the jobs of many who would have been engaged in the process of diagnosis. Every setting of your economy is experiencing the same trend. We are getting benefited with a cost of change in employment set up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*flntgTDXkPTOqQL2MUDZvQ.png" /></figure><p>If we talk about numbers according to world bank analysis [3], in Unites States 47 percentage of occupation at risk. Similarly, in Japan the number says 55 percentage and in Lithuania it’s 56 percentage. In developing countries like India and China its 69 percentage and 77 percentage respectively [4].</p><h3>Social Inference</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xpGzdmThbgMCzexl1dbTrA.jpeg" /></figure><p>Implications of the automation to the society can be polarized in many directions. It can be Psychological, Behavioral, Financial, Political and what not. The ecosystem of the society can be vastly dependent on the digitization. What can be a psychology of a patient when he/she can not feel the touch of a human doctor. Would a patient be that comfortable being treated by a machine though the margin of error is minimal? Will there be faithful connection between the patient and the robot? It would be difficult to fathom what would be our behavior in future. Again, contemplating that fact, many have argued introducing AI into our lives can affect the thought process of humans and may mould our behavior ethically. According to survey [5] when in a game some of the artificial bots were introduced, it completely changed the flow of the game. Previously people were behaving generously as the game demanded but afterwards the behavioral change happened, and people started behaving selfish. These are one of the social adversaries we might experience in social point of view. But what might be the impact when employment shifts because of the automation?</p><h3>The Argument</h3><p>AI always put across mixed opinions when it comes to refer job prospects. Looking at different economic and analyst projections, their findings seem to be everywhere. Some says there will be massive job losses across all the economic sectors, and some contradicts the point by saying there will be substantial employment growth due to the large increase in job productivity. But if we consider the job loss prospective again, we have multiple layers of impacts. If we look at the negative side, it will take away jobs from certain group of people. Subsequently it will affect the per capita income of population because of unemployment. But again, robotization might act as redistribution of labour. The job of workers might be robotized which will force the workers to shift to other work. Workers basically have variety of tasks. Some of them being taken by robots, workers must go through upskilling way to alleviate the gap between their skill and new task. Again, countries which are experiencing ageing process, where the operating age of population is lower, because of automation they surely can be benefited with their production needs. <br> <br>It’s hard not to believe that AI will eliminate the necessity of various posts to do different jobs, as we are already experiencing the discontinuity. But there exists many commentators who are optimist about usage of AI in every economic field. As per many researchers AI will initiate the opportunity to create new job categories. Historically when ever there has been increase in automation in one sector of occupation it has increased the work pressure of non-automated jobs in conjunction with the former one. But if the work has been fully automated then we can expect a reduction in jobs. <br> <br>But again, if due to AI if some sectors of work have been automated that does not necessarily alleviate the economy-wide employment. For example, as we have discussed above if in healthcare industry if AI is helping in faster diagnosis that means it will increase the patient intake number as well. If patient intake increases, there will be increase in demand of relative accessories to be used in recovery process of patients. Certainly, there must be an increase effort in work category to meet the demand. So, in other words the effect of humans replaced by the AI has been polarized in two direction. In one where it has cost some mundane, repetitive jobs and on the other hand there is transition of jobs from one area to another because of the automation in one field.</p><h3>The Optimism</h3><p>As cunningly mentioned by C. Pham [6] the discussion in context with automation and employment should not always address the negative prospective of the scenario that how many job cessations happened. It should embrace the various aspect of positivity like changing nature of work because of automatability. We can always create a healthy hybrid economic space where there will be cooperation and collaboration between humans and machines go hand in hand. This increased collaborative labour force can be the new big thing and has profound implications for jobs in the automated economy. This will give a new environment where people can strengthen their relationship, their skills. Workers can focus on aspects which demands creativity and social skills. But again, we must take special care that humans should not be brought under the domination of machines, otherwise it again will disturb the chemistry between the two and dismantle the ecosystem.</p><h3>The Question</h3><p>After all the arguments, now how to answer the same rhetoric question “will machines replace humans for many jobs?”. The answer is ambiguous. There are ample amount of comments in favor and against the perception. But I can see that the technical advances have short-term and long-term consequences. When we think about the short-term gaps, employment that we already have encountered with some economic sectors will certainly be replaced. There has been debates as well to overcome the scenarios. Education needs to be improved for the workforce so that they can take jobs required for automation, there must be robot tax system for every unemployment created by the robots, Concept of Universal Basic Income and many more. At a personal level like many researchers I think due to the injection of AI instead of human intelligence we eventually make a better and developed work environment where the whole work system will be redistributed. Human Workforce becomes smarter and interdependent. Ideally it would be wiser to be in economic space where we create a healthy and cooperative environment between machines and humans rather than subjugated to robots’ behaviors.</p><h3>Conclusion</h3><p>It’s hard. It’s hard to imagine what would be the equation of our job market in next say 20–30 years ahead. But our limited human minds reckon that perhaps the overall impact will only be unfavorable. But It would not be wrong to say that new categories of jobs will be created that directly contribute to AI-enabled infrastructure development. These jobs can compensate for shortfall of jobs that formerly might have happened due to automation or robotization. As cleverly stated by Kathleen Walch in his article [7] that <em>definitely Data scientists, robotic engineers, and ML programmers will not make up for fewer truck drivers or call center workers.</em> But the job creation will be there where we least expect it to happen. So, what will be the future employment scenario? Along with the job cessations and redistribution of work, will we encounter new dimensions and new categories of employment? We are certainly going through a revolutionary shift from developed industry to more developed automated industry. Many are referring this shift to a 4th industrial revolution. Transitions has shown us some ground level job closures with some skepticism. Along with that it has shown us the tremendous productivity benefits. So, with the new capabilities, there are questions which time must answer that which jobs will disappear, and which will show their rise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*jNP02N1GqMHADqdFKNSpfQ.jpeg" /><figcaption><a href="https://governmentciomedia.com/why-do-some-companies-have-humans-pretending-be-bots">source</a></figcaption></figure><h3>References</h3><p>[1] <a href="https://futurism.com/first-time-robot-passed-medical-licensing-exam">https://futurism.com/first-time-robot-passed-medical-licensing-exam</a> [2] <a href="https://www.healthline.com/health-news/are-you-ok-with-a-robot-dentist#1">https://www.healthline.com/health-news/are-you-ok-with-a-robot-dentist#1</a> [3]<a href="http://documents.worldbank.org/curated/en/816281518818814423/pdf/2019WDR-Report.pdf">http://documents.worldbank.org/curated/en/816281518818814423/pdf/2019WDR-Report.pdf</a> [4]<a href="https://www.businesstoday.in/management/career/beware-automationthreatens-69-">https://www.businesstoday.in/management/career/beware-automationthreatens-69-</a> per-cent-jobs-in-india-world-bank/story/238164.html [5]<a href="https://www.theatlantic.com/magazine/archive/2019/04/robots-humanrelationships/583204/">https://www.theatlantic.com/magazine/archive/2019/04/robots-humanrelationships/583204/</a> [6] <a href="https://www.ntu.edu.sg/home/cuong/docs/Pham-et-al-RAM-2018.pdf">https://www.ntu.edu.sg/home/cuong/docs/Pham-et-al-RAM-2018.pdf</a> [7]<a href="https://www.forbes.com/sites/cognitiveworld/2019/11/24/is-ai-a-job-killer-orjob-creator/#d044af337e8a">https://www.forbes.com/sites/cognitiveworld/2019/11/24/is-ai-a-job-killer-orjob-creator/#d044af337e8a</a> <a href="https://www.forbes.com/sites/cognitiveworld/2019/11/24/is-ai-a-job-killer-orjob-creator/#d044af337e8a">https://www.forbes.com/sites/cognitiveworld/2019/11/24/is-ai-a-job-killer-orjob-creator/#d044af337e8a</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aeff6ec48331" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Auto Encoder Network: A Complete Guide For Anomaly Detection in Tensorflow]]></title>
            <link>https://medium.com/analytics-vidhya/deep-auto-encoder-network-a-complete-guide-for-anomaly-detection-in-tensorflow-92f025e2c48d?source=rss-433f123f9ecd------2</link>
            <guid isPermaLink="false">https://medium.com/p/92f025e2c48d</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[autoencoder]]></category>
            <category><![CDATA[anomaly-detection]]></category>
            <dc:creator><![CDATA[Arya Mohapatra]]></dc:creator>
            <pubDate>Tue, 02 Jun 2020 12:50:06 GMT</pubDate>
            <atom:updated>2020-06-04T17:01:13.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*ceFLus1dOni0-sSbUgG4Iw.jpeg" /><figcaption><a href="https://www.researchgate.net/profile/Jeremie_Sublime/publication/333038461/figure/fig3/AS:757767321169921@1557677216019/Basic-architecture-of-a-single-layer-autoencoder-made-of-an-encoder-going-from-the-input.ppm">Image Source</a></figcaption></figure><p>Imagine a shelf is cleanly adorned by bottles of Irish whiskey and you see a milk bottle there:P. Ahh…That is odd. Isn’t it? So That odd, what we refer as an Anomaly.</p><p>In real life, we come across varieties of anomaly scenarios where certain entities deviate from the actual pattern they are supposed to follow. One of the significant examples of anomaly is fake credit card transactions which we are going to analyze today. There are certainly many more examples in real life where Anomaly detection is applicable like <a href="https://en.wikipedia.org/wiki/Intrusion_detection">intrusion detection</a>, <a href="https://en.wikipedia.org/wiki/Fraud_detection">fraud detection</a>, fault detection, system health monitoring, event detection in sensor networks, and detecting ecosystem disturbances.</p><h3><strong>Data:</strong></h3><p>What we analyze is a data of a credit card transaction which contains transaction details of cardholders. It contains the details of whether a transaction is a normal transaction or a fraud transaction that we can use as our dependent data for our model. The source of the data is <a href="https://www.kaggle.com/mlg-ulb/data">Kaggle</a>. Before moving, many of you must be having a thought, why cannot it be categorized as a classification problem? Certainly, it can be, but the main reason why we are addressing it as an anomaly is almost 82% of the transactions are normal and 18% have deviated from the actual normal transactions. Since the distribution among the classes is clearly not symmetric and one class is almost occupying the majority of the data, we can state the other class as an anomaly that demands an anomaly detection problem.</p><h3><strong>Pre-processing:</strong></h3><p>Preprocessing is an important step before feeding the data into any machine learning model. We need to understand the data. How many columns we are dealing with? Are all the columns contain numerical value? Is there any categorical text value that we need to convert into numerical values? Are there any missing values? All these checks must be taken into consideration before we move ahead.</p><p>Luckily, the data we have is absolutely a clean set of data. As you can see there are no Null values at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*LikA1FhM2pBsMPpcW42MQg.png" /></figure><p>There are 31 fields including the ‘Class’ notifying whether a transaction is Normal or Fraud. You can play around with the data to investigate more about it. Let’s see how many Normal and Fraud transactions present in the set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*qNEfecBe_w7y8vTf-hzZ3Q.png" /></figure><p>It clearly says more than 80% of the data belongs to Normal class and odd 20% is Fraud. Diving more deeper into the data, we have segregated the Normal and Fraud transactions and evaluate the Amount field for both the class. And by looking at the details you clearly cannot say if there is some discrepancy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*wFqhVBcT_WLY72dmPsgMRw.png" /></figure><h3><strong>Visualization:</strong></h3><p>Let us visually see how the values of certain fields are distributed. If we consider fields like V4, V7, V9, and V10 we can see the distribution as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*PqwPeU7ndaq1H3Z5XNhQDQ.png" /></figure><p>Now individually if we see the distribution of V4 or V10 field for both Normal and Fraud transactions we can come across the below findings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*xaN13G-5GJESGdY8-l63Zg.png" /></figure><p>The Green distribution belongs to Normal transactions and there one belongs to Fraud. Here we can see the Value of V10 for Normal transaction spreads over -20 to 3 but most of the fraud transactions have a V4 value close to zero. It is an interesting finding. Isn’t it? You can analyze the details for more fields and see the trend.</p><h3><strong>Autoencoder:</strong></h3><p>Let’s now understand what is Autoencoder.</p><p>Autoencoder is a neural network architecture which works on unsupervised learning technique to reconstruct the input values. In simple terms, we recreate the input value X given to a neural network with minimal error. The below image explains it better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*V-y-RM4XJAFdQ8ROsAMlsQ.png" /><figcaption><a href="https://www.jeremyjordan.me/autoencoders/">Image Source</a></figcaption></figure><p>In autoencoder, the input data that we give is basically compressed through a bottleneck in the architecture as we impose a lesser number of neurons in the hidden layers. As in the above diagram, the network takes an unlabelled data as input X and learns to output X̂ a reconstruction of original input by framing it as a supervised problem. The main idea of the network is to minimize the reconstruction error <strong>L </strong>(X, X̂) which is basically the difference between original input to the reconstructed output.</p><p>As we limit the number of layers in the hidden layer limited amount of information can flow through the network else if we give the same number of neurons in the hidden layer model will memorize the input data along with the network without learning important attributes about the input. Limiting neurons in the hidden layers will force the network to update the weights by being efficiently penalized according to the reconstruction error. The encoder state (as seen in the above fig.) actually helps the network to understand the underlying pattern of the input data and later on decoder layer learn how to re-create the original data from the condensed details.</p><h3><strong>How?</strong></h3><p>A simple question. How a model which is designed to reconstruct the input value can be used as a classifier to detect any anomaly like fraud transaction?</p><p>So the answer is, the Reconstruction error helps us to achieve the same. If we train a model to reconstruct non-fraudulent transactions, the network adjusts its weights for non-fraudulent transactions. When data of a fraud transaction been fed to the network then the mean squared error(MSE) of the output will be relatively higher for that input. And if the MSE is higher than a set threshold then we can easily classify that input as an anomaly. I hope that makes sense now.</p><p>But wait….!!! What is this threshold now? How do we know a perfect threshold?</p><p>Let&#39;s Find out 😊</p><h3><strong>Data Preparation for Training and Testing:</strong></h3><p>We have taken simple three steps prior to feeding the data into our model.</p><p>1. Standardized the data with min-max scaler</p><p>2. Kept 90% of Non-fraudulent transaction for training</p><p>3. Combine 10% of Normal transactions and entire fraud transactions to create our Validation and Test data.</p><h3><strong>Model:</strong></h3><p>After all the requisite pre-processing we finally will create the autoencoder model. We have used Tensorflow 2.0 to create our model. If you are not familiar with Tensorflow architecture I would suggest starting with Tensorflow official offerings [<a href="https://www.tensorflow.org/tutorials/quickstart/beginner">here</a>].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*Yv75_qQURp8-fd_ofk3Arg.png" /></figure><p>It might look intimidating at first if you are not well versed with TensorFlow but trust me it is not. We have used the Mean Squared Error loss function to calculate the Reconstruction error we have discussed above. To my design decisions, I have used <strong><em>Relu </em></strong>and <strong><em>Sigmoid </em></strong>as the activation functions. You are absolutely free to experiment with the hyperparameter choices for your model.</p><h3><strong>Training:</strong></h3><p>After all the set up we are now ready to train our model. After 50 epochs we can see the model has an accuracy of 99% with very minimal Loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*dBEbaZncSqyEwYJI0HW-ew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*NB6Oneatxb7_bbCH_m2kZA.png" /></figure><h3><strong>Right Threshold:</strong></h3><p>Once our model got trained and saved, we will use our Validation set to validate how well our data is performing.</p><p>Initially, we have done the data split and kept validation test data ready. If we inject the data into our trained model, we would be looking at results something like below.</p><p>If you remember in our validation dataset, we have both have normal transactions and Fraud transactions. Let’s see how the MSE has been calculated by the model for both the classes of transactions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*b8as02ojHjcBP9zi6WlZNA.png" /><figcaption>Error Details for Normal Transaction</figcaption></figure><p>Here if you see, for non-fraudulent transactions the average error is 0.000372. 50 percentile value is the median and the value is 0.000235. Subsequently, if we see the upper (75) percentile value is close to 0.0004. Which describes the MSE for the normal transaction is very minimal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*8NfXT_gKzw09_Er7g9l9HA.png" /><figcaption>Error Details for Fraud Transaction</figcaption></figure><p>Whereas if we see the details of Fraud transactions, we can clearly mark the error is almost 10 times higher than the normal transactions. Here the lower percentile of error value is 0.003 so we can guess anything above 0.001 can be a Fraudulent transaction as more than 75% values in normal transactions have an MSE less than 0.001.</p><p>Mark that deciding a threshold can be a trial and error method. We can always play around with the value. But our initial point, in this case, is 0.001.</p><p>A visual interpretation of how reconstruction error value is distributed for Fraud and Normal transactions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*BmBECXzOcN9KTbn1d5DOOQ.png" /><figcaption>Distribution of error for both the classes [Red]: Fraud - [Green]: Normal</figcaption></figure><h3>What’s Next?</h3><p>So by exploiting the error details we got a threshold value for MSE which suggests any transaction fed into the network if it gives an error more than a threshold value that will be considered as a fraud transaction.</p><p>Let’s now calculate on the same data set how many of the transactions we have successfully categorized correctly.</p><p>After comparing the error with the threshold value below is the confusion matrix we get for our results. This says we majority of the Normal transactions and Fraud transactions are correctly classified but still if we want to minimize the numbers for wrongly selected fraud transactions can try to set the threshold accordingly and see how it behaves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*qDiWnOvQgtg7NfSD_o0kWA.png" /><figcaption>Confusion Matrix for the Classification</figcaption></figure><h3>Evaluation:</h3><p>Let us now draw the ROC curve according to the classification we have done earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*zjjUMM27MnzTF9ACvhM1Zw.png" /><figcaption>ROC Curve for the classification</figcaption></figure><p>And if you see as per the ROC curve it has an AUC of 0.9560 which states our model is doing great in classifying the details.</p><h3>Conclusion:</h3><p>Finding anomaly is one of the interesting tasks for any problem solver and there is an ample number of models being used in industry for the task. Here we have seen how an Autoencoder can also be used as a classifier that can pick any disarrangement in a dataset which is a deviation from usual. I hope you have learned something great today. I have posted the entire code in my Git [<a href="https://github.com/aryamohapatra/Machine-Learning-Projects">link</a>]. Please refer to the same if you need any references.</p><h3>References:</h3><p>[1]:<a href="https://www.jeremyjordan.me/autoencoders/">https://www.jeremyjordan.me/autoencoders/</a></p><p>[2]:<a href="https://www.kaggle.com/rohandx1996/v-auto-encoder-vs-frauds-on-imbalance-data-wins/notebook">https://www.kaggle.com/rohandx1996/v-auto-encoder-vs-frauds-on-imbalance-data-wins/notebook</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92f025e2c48d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/deep-auto-encoder-network-a-complete-guide-for-anomaly-detection-in-tensorflow-92f025e2c48d">Deep Auto Encoder Network: A Complete Guide For Anomaly Detection in Tensorflow</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Logistic Regression from Scratch: Multi classification with OneVsAll]]></title>
            <link>https://medium.com/analytics-vidhya/logistic-regression-from-scratch-multi-classification-with-onevsall-d5c2acf0c37c?source=rss-433f123f9ecd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5c2acf0c37c</guid>
            <category><![CDATA[logistic-regression]]></category>
            <category><![CDATA[one-vs-all]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[scikit-learn]]></category>
            <dc:creator><![CDATA[Arya Mohapatra]]></dc:creator>
            <pubDate>Sat, 25 Jan 2020 01:25:25 GMT</pubDate>
            <atom:updated>2020-01-28T08:19:36.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YbUzYEjl4-asP1bSfXLSfw.png" /><figcaption><a href="https://www.coursera.org/learn/machine-learning">Source</a></figcaption></figure><p>Yes or No !! Red or Black !! Worthy or Not Worthy…Oh God !! Why do we have options ?🤔. Our world consists of lots of options oriented problems. Isn&#39;t it ?</p><p>So..In our real life how do we go about these scenarios where we have to choose a option? We analyse some aspects prior the decision. Like in a problem “what to wear (Red or Black) ?” We consider what kind of a occasion it is? When is the event? what would go right me being tanned 😁? So yes there are multiple factors that affects our decision. That’s exactly Logistic Regression does. In Logistic regression, we see the existing data which we call the dependent variables, we draw relation between them and we predict (the dependent variable) according to details we have. And what we predict is always dichotomous (binary).</p><p>But can we not use Logistic regression if we have multi-classification problem i.e. we have multiple dependent variables to predict ? In this article we will be building a model where using Logistic regression we will classify more than 2 variable.</p><p>But Let’s begin by understanding what is the idea behind Logistic Regression. “In Logistic regression, by the help of a hypothesis function which is also called as <strong>sigmoid </strong>function we calculate probabilities by giving some input data(known variables) and based on that, the model does the analysis to predict required classification.” What does this mean ? So if we have some dependent variables like x1,x2,x3.. and we have a function f(X),by using the dependent variables if our function calculates a number which lies between 0 to 1, then we can successfully classify the problem statement. So for a classification problem the basic concept of notation can be interpreted as the target values to be either 0 or 1. i.e. <strong>y ∈ {0, 1}.</strong> where y = Target or Dependent Variable.</p><p>So, if by some means we can find the value of our hypothesis function given X (feature values) in between a range of 0 to 1 then we can successfully classify the data set. So, if <strong>hθ​(x</strong>) is our Logistic regression function or hypothesis then,<strong> hθ​(x) </strong>need to satisfy the condition as<strong> 0≤ hθ​(x) ≤1.</strong> We can achieve the same by using <strong><em>θTX(Theta transpose X)</em></strong><em> </em>in our Logistic Function.The logistic function can be noted as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/193/1*WeB74Mbnc6Q0z7yK_9W44Q.png" /><figcaption><a href="http://: https://www.coursera.org/learn/machine-learning/supplement/AqSH6/hypothesis-representation">snippet source</a></figcaption></figure><p>The following image shows us what the sigmoid function(logistic function) looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*zi-WA-Eb2k5DeVLbMLhEGA.png" /><figcaption><a href="http://: https://www.coursera.org/learn/machine-learning/supplement/AqSH6/hypothesis-representation">snippet source</a></figcaption></figure><p>As we see above the g(z) function where z = θTX, will convert all the different valued features (dependent variables) into a number between 0 and 1. This will definitely help us in categorizing the target variables.</p><p>As we have mentioned earlier, logistic regression works on probability, so here our function(hθ​(x)) will give us the probability whether or not our output is 1. For example, if hθ​(x) = 0.8 then it says that chances of our output to be 1 is 80%. Hence from this we can deduct, the chances of our output to be 0 is 20%.</p><p><strong><em>Decision Boundary:</em></strong></p><p>In order to get our classification values 0 or 1, we can classify our features by inheriting the following understanding:</p><p><strong><em>If ,hθ</em>(<em>x</em>) ≥ 0.5 → <em>y</em>=1 and If <em>hθ</em>(<em>x</em>) &lt; 0.5 → <em>y</em>=0</strong></p><p>So, if our input to ‘<strong>g’</strong> is <strong>θTX</strong>, then that means, if <strong>θTX</strong> becomes more than 0 then our out probability will be close to 1 and we can classify the output to be 1 and vice versa. This idea can be noted as:</p><p><strong><em>hθ</em>(<em>x</em>) = <em>g</em>(<em>θTX</em>) ≥ 0.5 <em>when θTX </em>≥ 0</strong></p><p><strong><em>θTX</em> ≥ 0 </strong>⇒<strong><em>y</em>=1</strong></p><p><strong><em>θTX </em>&lt; 0 </strong>⇒<strong><em>y</em>=0</strong></p><p>The decision boundary is the line that separates the area where <strong><em>y = 0</em></strong> and where <strong><em>y = 1</em></strong>. It is created by our hypothesis function.</p><p><strong><em>Cost Function:</em></strong></p><p>The main objective of our model should be to find out the weights i.e . <strong><em>θ </em></strong>values.In order to find out the <strong><em>θ </em></strong>values we need a function (let’s call it cost function) and minimize it’s value by using different values of <strong><em>θ</em></strong>. The weights that will minimize the cost function will be our best suited weights.<strong><em> </em></strong>In Logistic regression we need to select a function which will be a convex function so that we can find out the local optima accordingly.</p><p>cost function for logistic regression looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/1*SQBj1s8D72X4ROVJPY12KA.png" /><figcaption><a href="https://www.coursera.org/learn/machine-learning/supplement/bgEt4/cost-function">source</a></figcaption></figure><p>Cost(hθ(x), y) =−log(hθ(x)), if y = 1</p><p>Cost(hθ(x), y) =−log(1−hθ(x)), if y = 0</p><p>Cost(hθ(x), y) =0 if hθ(x)=y</p><p>Cost(hθ(x), y) →∞ if y=0 and hθ(x)→1</p><p>Cost(hθ(x), y) →∞ if y=1 and hθ(x)→0</p><p>We have plotted the cost function in our solution which shows the similar pattern. We generally start by picking random theta values and subsequently update the values with the help of gradient descent and measure how good our model turned out. That value is computed using the cost function, defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*PhGWYNV-SB_FqvZQFm77gA.png" /><figcaption><a href="https://www.coursera.org/learn/machine-learning/supplement/bgEt4/cost-function">source</a></figcaption></figure><p><strong><em>Gradient descent</em></strong></p><p>Our goal is to minimize the cost function and by changing the weights that is theta value we can achieve the same. We can update the <strong><em>θ </em></strong>values by taking the derivative of the cost function with respect to each weight. We can repeat the below formula for the same:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/198/1*_V1y7J2MjFEPdFQKOXXQrg.png" /><figcaption><a href="https://www.coursera.org/learn/machine-learning/supplement/0hpMl/simplified-cost-function-and-gradient-descent">Source</a></figcaption></figure><p>The same formula can be written as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*fSXJ65xtVwi4E7T_wvzpuA.png" /><figcaption><a href="https://www.coursera.org/learn/machine-learning/supplement/0hpMl/simplified-cost-function-and-gradient-descent">Source</a></figcaption></figure><p>Below is the vectorized notation of the above formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*VEXLo0acWAT3fwb8YlWTDw.png" /><figcaption><a href="https://www.coursera.org/learn/machine-learning/supplement/0hpMl/simplified-cost-function-and-gradient-descent">Source</a></figcaption></figure><p>The alpha notation used is called the learning rate. It will basically help us in propagating towards the local optima of our convex function. I would suggest to read following article (<a href="https://towardsdatascience.com/understanding-the-mathematics-behind-gradient-descent-dde5dc9be06e"><strong><em>Gradient Descent</em></strong></a><strong><em>) </em></strong>to know more about Gradient descent and associated terms.</p><p><strong><em>Multi-class Classification: One-vs-all :</em></strong></p><p>Now we are going to approach data classification when we have more than two categories. We must extend our description instead of <strong><em>y = { 0,1 }</em></strong>, so that <strong><em>y = { 0,1 … n}</em></strong>.</p><p>One-vs-all is a strategy that involves training N distinct binary classifiers, each designed to recognize a specific class. After that we collectively use those N classifiers to predict the correct class. How do we do it in code? By considering one class as 1 and rest all as 0, we train the model and get the requisite wights(theta value). We store the value of weights in a dictionary format for each classifiers. Then by the help of <strong>Sigmoid Function</strong> we calculate the probability. Highest probability takes a presidency and we classify that data to corresponding classifier.</p><p><strong><em>The Code:</em></strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44f987aab6cff945814022b645e7fbd1/href">https://medium.com/media/44f987aab6cff945814022b645e7fbd1/href</a></iframe><p><strong>Execution of the Model:</strong></p><p>In the <strong>Fit ()</strong> method we have implemented one vs Rest algorithm as the data set demands a multi-classification model. We are iterating the code for distinct label times and then finding out the <strong>θ</strong> values by the gradient descent method. Similarly, we are also calculating the Cost function value with respect to the corresponding <strong>θ</strong> value. After we get the optimal <strong>θ</strong> value for each label type, by the help of <strong>Predict ()</strong> method we are finding the max probability for a given feature using the <strong>θ </strong>values we initially found. Hence, we classify each feature input by obtaining the maximum probability for that input.</p><p><strong>Plotting the Cost Value:</strong></p><p>As this data set contains a multi-classification problem, we basically expanded our definition so that y = {0,1…n}. In this case we have 3 categories, so we have accordingly found cost values 3 different occasions by following One-Vs-All methodology. Hence, we have 3 different Plots for the corresponding cost values. Considering the values of Cost with respect to categories PFB the plot of Cost vs no of Iterations we have taken. We can clearly see the Cost value is reducing and heading towards the value Zero with each iteration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*FRLk1tWuTAfgsXacbqEfFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*V1MhiXMOr_YogCTQOFS1HA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*yZK-OK_hF6zkoTuxegMo_A.png" /></figure><p>We have now successfully implemented Logistic regression multi classification algorithm which can be used to classify more than 2 target variables.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5c2acf0c37c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/logistic-regression-from-scratch-multi-classification-with-onevsall-d5c2acf0c37c">Logistic Regression from Scratch: Multi classification with OneVsAll</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>