Sorry, obviously some sloppy work :s


On 13 February 2014 00:01, Arnaud Joly <notifications@github.com> wrote:

>  In sklearn/datasets/samples_generator.py:
>
> > -
> > -        return x, y
> > -
> > -    X, Y = zip(*[sample_example() for i in range(n_samples)])
> > +        n_words = 0
> > +        while n_words == 0:
> > +            n_words = generator.poisson(length)
> > +
> > +        # generate a document of length n_words
> > +        if len(y) == 0:
> > +            # if sample does not belong to any class, generate noise word
> > +            words = generator.randint(n_features, size=n_words)
> > +            return words, y
> > +
> > +        # sample words with replacement from selected classes
> > +        cumulative_p_w_sample = np.cumsum(np.take(p_w_c, axis=1).sum(axis=1))
>
> cumulative_p_w_sample = p_w_c.take(y, axis=1).sum(axis=1).cumsum() would
> make Travis happy.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/scikit-learn/scikit-learn/pull/2828/files#r9666084>
> .
>