On 03/28/2012 06:18 PM, Lars Buitinck wrote: > 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? > How about something like
(D[:, 1] - D[:, 0]) / (D[:, 1] + D[:, 0]) Would that solve the problem? How would you formulate the information as uncertainty? ------------------------------------------------------------------------------ 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
