Build a very straightforward and fully functional machine

Assignment Help JAVA Programming
Reference no: EM13692649

KNN Assignment:

Build a very straightforward and fully functional machine learning classifier with the K-Nearest Neighbor (KNN) algorithm. The KNN model will read a set of data specified by the user, decide the appropriate class of the new instance, and finally output the performance metrics of the model based on test data set.

Requirements:

  • The implementation should  be written in Java.
  • The distance metric used  should be Euclidean distance.
  • The model should use the  training data set as the existing data set to classify the data in the  test set.
  • The performance metrics  output needs to include the confusion matrix and accuracy  (1-misclassification rate).
  • The code must be commented  so that each implemented component of the KNN algorithm is properly  labeled.
  • Use object-orien ted techniques (do not make the whole program one monolithic procedu ral implementation).
    • Separate the distance  calculations, sorting, data structure, and other components so that each  of them can be developed and reviewed individually.
  • Implement the classifier  as a standalone program.

Assignment Deliverable:

This is what I need for my output

1) All source code

2) A copy of the output when K=3

3) A copy of the output when K=5

4) A copy of the output when K=7

5) Confusion matrix and accuracy

A few notes:

- Input/output streams

- Distance calculation

- KNN algorithm

- Confusion matrix and accuracy

- Object-oriented and commented codes

2) You must take the input file path from the command line. We want students to learn how to input dataset from file into memory. In the real world, we will run multiple datasets via multiple files to analyze the results. Coding the file name in your program is not practical.

3) Make sure you test all the rows and use all the other data points as your training data. For example, when you are testing row 1, you need to use rows 2 to 150 as the training data for the calculation. When you are testing row 2, you need to use rows 1 and rows 3 to 150 for the calculation.

4) You should not use a K with an even number. After locating the K nearest neighbors, we need to take the majority for the predicted value. An even number K will potentially have many ties when you are trying to select the majority.

5) I may choose to run a subset of the input data. Please make sure your program works for any input data with the same format.

Reference no: EM13692649

Questions Cloud

Calculate the payments for the new loan. : Crazy hours Construction purchased a new loader for $280,000 using a 25 annual end of year payment plan at 10% interest. At the end of 10 years they decided to refinance the loader with a new company with 15-year loan.
Earth-moving equipment is considering an investment : A profitable company making earth-moving equipment is considering an investment of $100,000 on equipment, which will have a 5 year useful life and, no salvage value. If money is worth 10% which one of the following there methods of depreciation would..
What is the marginal revenue product of the fourth worker : What is the marginal product of the third worker? What is the marginal revenue product of the fourth worker? What is the marginal cost of the sixth worker?
Build distributed applications using technologies : Build distributed applications using technologies like Unix and Java sockets, SUN RPC, Java RMI, and message-passing tools such as PVM and MPI and
Build a very straightforward and fully functional machine : Build a very straightforward and fully functional machine learning classifier with the K-Nearest Neighbor (KNN) algorithm. The KNN model will read a set of data specified by the user, decide the appropriate class of the new instance, and finally o..
Determine the classification of the lease for us gaap : Determine the classification of the lease for US GAAP?  Does the classification differ for IFRS?  If so, why?  Provide comments where any judgment by CCI's management would be necessary.
Lagging indicators and unemployment rate the price of gold : Economists argue at what point of the Business Cycle our country is now situated. Utilizing the concepts of leading, coincident and lagging indicators and Unemployment rate the price of gold and oil is rapidly raising and gasoline is often over $4.00..
How much will energy maxs payment drop with the new loan : Energy Max engineering constructed a small office building for their firm 5 years ago. They financed it with bank loan for $450000 over 15 years at 6% interest with quarterly payment and compounding. The loan can be refinanced through an insurance fi..
How many cigars and brandy does he consume per night : How many cigars and brandy does he consume per night? (Money is no object!) What if J.P.'s doctor tells him that he should limit his consumption of (the sum of) cigars and brandy to 5 per night. If he follows this advice, how many glasses of brandy a..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a program that asks the user to enter three names

Write a program that asks the user to enter three names

  Create file lab7.java with a main method.

Create file Lab7.java with a main method. Inside your main method, write a segment of code which instantiates an object of the Student class (This class has been created for you in the  Student.java  file that is provided as part of this lab).

  Create an application that provides a solution

Create an application that provides a solution for problem 20.8 In addition to requirements specified in the description.

  Design a java program that simulates a slot machine

Design a java program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. ? Instead of displaying images, the program will random..

  Length of the string in order to reserve space

To determine the length of the string in order to reserve space for the new string use the library routine strlen. Register a1 contains a pointer to the string to measure and on return register a1 has the number of characters in the string. You..

  Describe how an eavesdropped can gain access

Describe how an eavesdropped can gain access to the remote server with a relatively modest number of guesses ( Hint:  The eavesdropped starts guessing after the original user has typed all but one character of the password.

  Create a project using the classes in the doc sharing area

create a project using the classes in the Doc Sharing area labeled A Simple LinkedList class. Compile it, run it, and review the code that is given carefully. This code tests the LinkedList class provided in the lecture.

  1 gqueuea queue is an ordered collection of items in which

1 gqueuea queue is an ordered collection of items in which the removal of items is restricted to the fifo rst in rst

  Java application that reads a date in numeric form

Designand write a java application that reads a date in numeric form from a set of three fields and displays it in English within a label. Use appropriate buttons. For Example:

  Write a method compact that removes all zeroes

Write a program that reads a text file (compact.txt) and stores the integers in an array.  Your instructor will provide this text file.

  Create an application that will allow a new customer

Create an application that will allow a new customer to order a house. You'll allow the customer to choose among four models (Aspen, Britattany, Colonial, and Dartmoor) by creating separate ButtonGroups.

  Explain the graphical coordinate system in java where is

question 1 describe the graphical coordinate system in java. where is the origin? what units apply to the xy

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd