trainSet = [[2, 2, 2, 'a'], [4, 4, 4, 'b'], [6, 6 , 6, 'b'] testInstance = [5, 5, 5] Similarity: Calculate the Euclidian distances between the testInstance and all point of trainSet (Three points) In our case: Three distances between [5, 5, 5] and [2, 2, 2], [4, 4, 4], [6, 6 , 6] Neighbors: Locate k (Choose k=2 points in trainSet) most similar data instances by choosing the points of trainSet with the minimum distances between the testInstance and all point of trainSet. In our case: The two points are: [4, 4, 4], [6, 6 , 6]
Response: Generate a response from a set of data instances. In our case: The most similar data instances are [4, 4, 4, 'b'], [6, 6 , 6, 'b'], the testInstance will be affected by the letter ‘b’ (method of majority voting). using java

Reverend Jim commented: lazy and rude -3

Recommended Answers

All 2 Replies

What do you have so far?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.