Ex. 13.8 (TODO)

Ex. 13.8

Generate data in two classes, with two features. These features are all independent Gaussian variates with standard deviation 1. Their mean vectors are \((-1,-1)\) in class 1 and \((1, 1)\) in class 2. To each feature vector apply a random rotation of angle \(\theta\), \(\theta\) chosen uniformly from 0 to \(2\pi\). Generate 50 observations from each class to form the training set, and 500 in each class as the test set. Apply four different classifiers:

(1) Nearest-neighbors.

(2) Nearest-neighbors with hints: ten randomly rotated versions of each data point are added to the training set before applying nearest-neighbors.

(3) Invariant metric nearest-neighbors, using Euclidean distance invariant to rotations about the origin.

(4) Tangent distance nearest-neighbors.

In each case choose the number of neighbors by tenfold cross-validation. Compare the results.