Sure. I'll try get to this on the weekend.


On 8 April 2014 19:42, Lars Buitinck <notifications@github.com> wrote:

> In sklearn/neighbors/tests/test_neighbors.py:
>
> > @@ -94,6 +95,24 @@ def test_unsupervised_inputs():
> >          assert_array_almost_equal(ind1, ind2)
> >
> >
> > +def test_unsupervisd_knn_distance():
> > +    """Tests unsupervised NearestNeighbors with a distance matrix."""
> > +    X = rng.random_sample((3, 3))
> > +    D = metrics.pairwise_distances(X, metric='euclidean')
> > +    # As a feature matrix (n_samples by n_features)
> > +    nbrs_X = neighbors.NearestNeighbors(n_neighbors=3)
> > +    nbrs_X.fit(X)
> > +    dist_X, ind_X = nbrs_X.kneighbors(X)
> > +    # As a dense distance matrix (n_samples by n_samples)
> > +    nbrs_D = neighbors.NearestNeighbors(n_neighbors=3, algorithm='brute',
> > +                                        metric='precomputed')
> > +    nbrs_D.fit(D)
>
> Can you try to pickle nbrs_D in the test? (Since you're using a lambda.)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/scikit-learn/scikit-learn/pull/2532/files#r11382858>
> .
>