Thanks to visit codestin.com
Credit goes to github.com

Skip to content

make_circles always generates an even number of samples #10037

Closed
@christianbraune79

Description

@christianbraune79

Description

sklearn.datasets.make_circles always generates an even number of samples, even when specifically asked for an uneven number.

Steps/Code to Reproduce

Example:

from sklearn.datasets import make_circles

n_samples = 101
xs, ls = make_circles(n_samples=n_samples)
assert(len(xs)==len(ls)==n_samples)

Expected Results

No Assertion Error should be thrown (in the example) OR the amount of data points generated should match the value supplied to the function OR a warning should be given.

Possible fix: Calculate the number of data points per cluster as in make_moons

Actual Results

Assertion Error, No warning, lower number of points returned than asked for.

Versions

Windows-10-10.0.15063
('Python', '2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)]')
('NumPy', '1.13.0')
('SciPy', '0.16.1')
('Scikit-Learn', '0.19.1')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions