A Radius Nearest Neighbors model.
The doc is here : http://scikit-learn.org/dev/modules/generated/sklearn.neighbors.RadiusNeighborsClassifier.html#sklearn.neighbors.RadiusNeighborsClassifier
Le rayon doit être grand pour que chaque point ait au moins un voisin, sinon l’algorithme râle !
Dans ce script, j’utilise sklearn.grid_search pour explorer automatiquement un ensemble de méta-paramètre.
$ python RNN.py
Opening the file 'train.csv' and 'test.csv'...
Searching for parameters in {'radius': [100.0, 1000.0, 10000.0, 500.0, 5000.0, 50000.0], 'leaf_size': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]}.
Learning...
Proportion of perfect fitting for the training dataset = 61.62%
The best parameters are : {'radius': 100.0, 'leaf_size': 1}.
Predicting for the testing dataset
Prediction: wrote in the file csv/RNN_best.csv.
The score for this classifier.