<div dir="ltr"><div><div><div>Joel,<br><br></div>Your explanation helped me understand it.<br><br></div>Thanks!<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-02 19:10 GMT-02:00 Joel Nothman <span dir="ltr"><<a href="mailto:joel.nothman@gmail.com" target="_blank">joel.nothman@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 3 January 2017 at 07:44, Pedro Pazzini <span dir="ltr"><<a href="mailto:pedropazzini@gmail.com" target="_blank">pedropazzini@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>Hi all!<br><br>I'm trying to use a <span id="m_-7418907151599811855m_-2587101010317685335gmail-:27c.8">KNeighborsClassifier</span> with precomputed metric. In it's predict method (http://<span id="m_-7418907151599811855m_-2587101010317685335gmail-:27c.9">scikit</span>-<a href="http://learn.org/stable/modules/generated/" target="_blank">learn.org/stabl<wbr>e/modules/generated/</a><span id="m_-7418907151599811855m_-2587101010317685335gmail-:27c.10">sklearn</span>.<wbr>neighbors.<span id="m_-7418907151599811855m_-2587101010317685335gmail-:27c.11">KNeighborsClassifier</span><wbr>.html#<span id="m_-7418907151599811855m_-2587101010317685335gmail-:27c.12">sklearn</span>.neighbors.<span id="m_-7418907151599811855m_-2587101010317685335gmail-:27c.13">KNeigh<wbr>borsClassifier</span>.predict) it says the input should be:<br><br>"(n_query, n_indexed) if metric == ‘precomputed’"<br><br></div>What is n_indexed? <br><br></div><div>Shouldn't the shape of the input in the predict method be (n_query,n_query)?<br></div><div><br>How can I use the predict method after fitting the classifier with a distance matrix?<br><br></div>Regards,<br></div>Pedro <span id="m_-7418907151599811855m_-2587101010317685335gmail-:27c.14">Pazzini</span><br></div>
<br></div></div>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org" target="_blank">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/scikit-learn</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
scikit-learn mailing list<br>
<a href="mailto:scikit-learn@python.org">scikit-learn@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/scikit-learn" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/scikit-learn</a><br>
<br></blockquote></div><br></div>