Skip to content

test_numeric_stability can be parametrize with pytest #14220

Closed

Description

@thomasjpfan

test_numeric_stability can be parametrize with pytest:

def test_numeric_stability():
X_init = np.array([2., 4., 6., 8., 10.]).reshape(-1, 1)
Xt_expected = np.array([0, 0, 1, 1, 1]).reshape(-1, 1)
# Test up to discretizing nano units
for i in range(1, 9):
X = X_init / 10**i
Xt = KBinsDiscretizer(n_bins=2, encode='ordinal').fit_transform(X)
assert_array_equal(Xt_expected, Xt)

(Using this as an example of how to contribute to scikit-learn for a talk)

Activity

  1. added
    Easy
    good first issue
    on Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Easygood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions