Hi all,
I just suggested [1] adding a decision_function to @robertlayton's new
NearestCentroid classifier and tried to implement one, but I got stuck
on the binary case. In the multiclass case, the decision function is
simple: it would be
D = -pairwise_distances(X, self.centroids_, metric=self.metric)
which has shape (n_samples, n_classes), so that classification can be
performed by D.argmax(axis=1).
But in the binary case, linear models return an (n_samples, 1)-shaped
array and I was wondering if NearestCentroids should do the same? We
could do that by subtracting D[:, 1] - D[:, 0], but doing so we seem
to lose interesting information.
What to do?
[1] https://github.com/scikit-learn/scikit-learn/pull/690#issuecomment-4759848
TIA,
Lars
--
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general