8000 datasets.make_moons returns incorrect label when n_samples is odd · Issue #8198 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

datasets.make_moons returns incorrect label when n_samples is odd #8198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
levy5674 opened this issue Jan 13, 2017 · 0 comments · Fixed by #8199
Closed

datasets.make_moons returns incorrect label when n_samples is odd #8198

levy5674 opened this issue Jan 13, 2017 · 0 comments · Fixed by #8199

Comments

@levy5674
Copy link
Contributor

Description

There is an indexing error in make_moons so that when n_samples is odd, x[n_samples // 2] is on the inner circle but y[n_samples // 2] == 0 labeling it as part of the outer circle.

Steps/Code to Reproduce

from sklearn.datasets import make_moons
from numpy import column_stack
column_stack(make_moons(3, shuffle=False))

Expected Results

array([[ 1. ,  0. ,  0. ],
       [ 0. ,  0.5,  1. ],
       [ 2. ,  0.5,  1. ]])

Actual Results

array([[ 1. ,  0. ,  0. ],
       [ 0. ,  0.5,  0. ],
       [ 2. ,  0.5,  1. ]])

Versions

Darwin-15.6.0-x86_64-i386-64bit
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:52:12)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)]
NumPy 1.11.2
SciPy 0.18.1
Scikit-Learn 0.18

levy5674 pushed a commit to levy5674/scikit-learn that referenced this issue Jan 13, 2017
levy5674 pushed a commit to levy5674/scikit-learn that referenced this issue Jan 14, 2017
levy5674 pushed a commit to levy5674/scikit-learn that referenced this issue Jan 16, 2017
raghavrv pushed a commit to raghavrv/scikit-learn that referenced this issue Jan 18, 2017
sergeyf pushed a commit to sergeyf/scikit-learn that referenced this issue Feb 28, 2017
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this issue Jun 14, 2017
NelleV pushed a commit to NelleV/scikit-learn that referenced this issue Aug 11, 2017
paulha pushed a commit to paulha/scikit-learn that referenced this issue Aug 19, 2017
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this issue Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0