Python Forum

Full Version: Predict data class using euclidean distance
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I currently have an assignment to write a python function to compute predictions according to the mean Euclidean distance to the sample points of each class. I also need to determine the training error. The function should have the following interface function:

[prediction] = meanPrediction(C1, C2, UnknownC)

This is what I have been able to determine:

- UnknownC should be composed by the training set or, in other words, C1 and C2.
- C1 and C2 are a single column arrays with 10 lines each, which means UnknownC is a single column array with 20 lines.

I was also able to compute all three arrays and the euclidean distance between C1 and C2. However, I don't know how to make the predictions for UnknownC using the distance I acquired, neither compute the training error.

Thanks in advance for any help that you may give.

Best regards,
Luis