If I understood, each row of the input matrix in the predict method contains the distances from a query point to each point in the training set.
I think the reference should make this more clear. 2017-01-03 15:31 GMT-02:00 federico vaggi <[email protected]>: > That would be most helpful. Maybe also explain the logic? > > On Tue, 3 Jan 2017 at 18:19 Andy <[email protected]> wrote: >> >> Should probably be called n_samples_train? >> >> >> On 01/02/2017 04:10 PM, Joel Nothman wrote: >> >> n_indexed means the number of samples in the X passed to fit. It needs to >> be able to compare each prediction sample with each training sample. >> >> On 3 January 2017 at 07:44, Pedro Pazzini <[email protected]> wrote: >>> >>> Hi all! >>> >>> I'm trying to use a KNeighborsClassifier with precomputed metric. In it's >>> predict method >>> (http://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsClassifier.html#sklearn.neighbors.KNeighborsClassifier.predict) >>> it says the input should be: >>> >>> "(n_query, n_indexed) if metric == ‘precomputed’" >>> >>> What is n_indexed? >>> >>> Shouldn't the shape of the input in the predict method be >>> (n_query,n_query)? >>> >>> How can I use the predict method after fitting the classifier with a >>> distance matrix? >>> >>> Regards, >>> Pedro Pazzini >>> >>> _______________________________________________ >>> scikit-learn mailing list >>> [email protected] >>> https://mail.python.org/mailman/listinfo/scikit-learn >>> >> >> >> >> _______________________________________________ >> scikit-learn mailing list >> [email protected] >> https://mail.python.org/mailman/listinfo/scikit-learn >> >> >> _______________________________________________ >> scikit-learn mailing list >> [email protected] >> https://mail.python.org/mailman/listinfo/scikit-learn > > > _______________________________________________ > scikit-learn mailing list > [email protected] > https://mail.python.org/mailman/listinfo/scikit-learn > _______________________________________________ scikit-learn mailing list [email protected] https://mail.python.org/mailman/listinfo/scikit-learn
