0

He can help me how i can create this program please

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)

14th Apr 2022, 8:16 PM
Walid
Walid - avatar
2 Respostas
0
Please share your code from the code playground and someone can help you.
15th Apr 2022, 2:20 AM
Ausgrindtube
Ausgrindtube - avatar
0
Bonsoir monsieur ; vous avez trouver la solution de cette exo si vous laver trouver envoyer la svp ,j'ai le même exo est j'ai pas trouver de solution
30th Apr 2022, 9:39 PM
Mohamed BELKADI
Mohamed BELKADI - avatar