metric-learn
metric-learn copied to clipboard
[WIP] Add model selection example with LFW dataset and KNN task
I created a model selection example for supervised Mahalanobis learners, to show the effectiveness of the linear transformation.
I use a "large" dataset from sklearn: Labeled Faces in the Wild (LFW) people dataset (classification). That it's a bit more complex than using iris, and for the same reason I use PCA to reduce dimentionality.
The usual pipeline would be: PCA-> Classifier, but in this case we try PCA-> Metric learner-> Classifier, and we compare how precision, recall and f1 scores vary to the first scenario that I call a baseline.
To compare models I fixed the last Classifier being a KNeighborsClassifier
.
In general, all supervised learners are able to outperform the baseline.
I think this example can be useful to users, because its hard to know beforehand which model will perform the best with our dataset.
Note: The models's parameters are not tuned, this example act as a "final" comparison between models.