Implement the kNN algorithm in python without using the libraries with both Euclidean and Manhattan distance...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Implement the kNN algorithm in python without using the libraries with both Euclidean and Manhattan distance and apply on the data given below: Age 25 35 45 20 35 52 23 40 60 48 33 Loan 40000 60000 80000 20000 120000 18000 95000 62000 100000 220000 150000 Default N N N N N N Y Y Y Y Y Income 102000 82000 62000 122000 22000 124000 47000 80000 42000 78000 8000 Generate the age randomly in the range 18 - 60 and Loan in the range 20000 150000. Income column may be kept the same. Now classify an unknown case (Age = 48, Loan = 142000, Income = 50000) Implement the kNN algorithm in python without using the libraries with both Euclidean and Manhattan distance and apply on the data given below: Age 25 35 45 20 35 52 23 40 60 48 33 Loan 40000 60000 80000 20000 120000 18000 95000 62000 100000 220000 150000 Default N N N N N N Y Y Y Y Y Income 102000 82000 62000 122000 22000 124000 47000 80000 42000 78000 8000 Generate the age randomly in the range 18 - 60 and Loan in the range 20000 150000. Income column may be kept the same. Now classify an unknown case (Age = 48, Loan = 142000, Income = 50000)
Expert Answer:
Answer rating: 100% (QA)
income case2 default case3 euclideandist euclideandistanceage loan income unknowncase0 unknown... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
The following is the production function of a farm in Maseno. y=x, +0.1x-0.05x+x+0.1x-0.05x a) Find the maximum output and the corresponding level of input use at which output is maximized. (6 marks)...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
TH, has two electrons in 3) o Accodng ery, a moleule 4) o Hydrogen bondd is 2) A weak electrostatic force 4) It is not a bond 1)A weak covaient bund 3) A weak metallic force 11. Bydrogen bond may 1)...
-
Illustrated is a rectangular steel bar with simple supports at the ends and loaded by a force F at the middle; the bar is to act as a spring. The ratio of the width to the thickness is to be about b...
-
Presented below is financial information related to the 2017 operations of Delgado Cruise Company SA. Maintenance and repairs expense..............................R$ 97,000 Utilities...
-
The sky hook is used to support the cable of a scaffold over the side of a building. If it consists of a smooth rod that contacts the parapet of a wall at points A, B, and C, determine the normal...
-
Moonlight Drive-Ins Ltd. borrowed money by issuing $2,000,000 of 4% bonds payable at 97.5 on July 1, 2014. Te bonds are 10-year bonds and pay interest each January 1 and July 1. 1. How much cash did...
-
Some time ago, you entered a forward contract to purchase 10 shares of Advanced Micro Devices, Inc. (AMD) for $32 per share. Your forward contract ends in 6 months and the current spot price of AMD...
-
The following information pertains to the City of Williamson for 2020, its first year of legal existence. For convenience, assume that all transactions are for the general fund, which has three...
-
Discuss the implications of a misstated useful life of a category of capital equipment. What steps would you take to amend the error to reconcile the figures with other accurate financial statements?
-
This problem refers to right triangle ABC with C = 90 Begin the problem by drawing a picture of the triangle with both the given and asked for information labeled appropriately. If B = 51.88 and b =...
-
Pronghorn Design Works generated $315,840 in operating income on sales revenue of $2,632,000. The company had $1,860,000 in assets on January 1 and $2,840,000 in assets on December 31. (a-b) (a)...
-
The following items are necessary for preparing the 2 0 2 4 year - end adjustments for Rogers Advertising Agency. Rogers s fiscal year - end is December 3 1 . On July 1 , 2 0 2 4 , Rogers received $...
-
ABC Advertising, owned by Mr Anish, provides advertising consulting services. During January 2 0 2 1 , the following events occurred: Jan. 2 Owner contributed Rs . 5 0 , 0 0 0 and a new computer...
-
Heart Lake developments sold four lakefront lots for $ 3 0 , 5 0 0 per hectare. If the sizes of the lots in hectares were 3 1 2 , 2 3 7 , 5 5 8 , and 4 4 9 respectively, what was the total sales...
-
Select a community that could be considered for opening the company store/selling the companys product (i.e. area in Toronto, must be in Canada) provide the name of the community We decided to open...
-
In Exercises find dy/dx by implicit differentiation. xy - y = x
-
Patty Bayan is a single taxpayer living at 543 Space Drive, Houston, TX 77099. Her Social Security number is 466-33-1234. For 2012, Patty has no dependents, and her W-2 from her job at a local...
-
Mark owns his home and has a $250,000 mortgage related to his purchase of the residence. When his daughter went to college in the fall of 2012, he borrowed $20,000 through a home equity loan on his...
-
Ken (age 31) and Amy (age 28) Booth have brought you the following information regarding their income, expenses, and withholding for the year. They are unsure which of these items must be used to...
-
Why are none of the bulbs in Figure 31. 24 lit? Data from Figure 31. 24 Figure 31.24 (1) (iii) NNN
-
In Figure 31. 25, identify the energy conversions that occur between points \(A\) and \(B, B\) and \(\mathrm{C}, \mathrm{C}\) and \(\mathrm{D}\), and \(\mathrm{D}\) and \(\mathrm{A}\). Data from...
-
In Figure 31. 26, bulb B is brighter than bulb C, which in turn is brighter than bulb A. Rank, largest first, \((a)\) the magnitudes of the potential differences across the bulbs, \((b)\) the...
Study smarter with the SolutionInn App