Skip to content

sklearn dev tests failing (deprecated argument to OneHotEncoder and QuantileTransformer) #517

Closed

Description

@stsievert

OneHotEncoder's n_values argument is deprecated pulled out in scikit-learn/scikit-learn#13855 (and specifically _encoders.py#L281).

Here's some of the output from the Azure tests in #221:

tests/compose/test_column_transformer.py:38:

>  #   def test_column_transformer():
>               (dask_ml.preprocessing.OneHotEncoder(sparse=False), ["A"]),
>         signature = {
            "n_values": n_values,
            "categorical_features": categorical_features,
            "categories": categories,
            "drop": drop,
            "sparse": sparse,
            "dtype": dtype,
            "handle_unknown": handle_unknown,
        }
>       super(OneHotEncoder, self).__init__(**signature)
E       TypeError: __init__() got an unexpected keyword argument 'n_values'

Activity

  1. changed the title [-]sklearn dev tests failing[/-] [+]sklearn dev tests failing (deprecated argument to OneHotEncoder)[/+] on Jun 7, 2019
  2. changed the title [-]sklearn dev tests failing (deprecated argument to OneHotEncoder)[/-] [+]sklearn dev tests failing (deprecated argument to OneHotEncoder and QuantileTransformer)[/+] on Jun 8, 2019
  3. stsievert commented on Jun 8, 2019

    @stsievert
    MemberAuthor

    The QuantileTransformer test is also failing because Scikit-Learn now uses self._check_array(..., copy=True) in QuantileTransformer.fit. This is implemented in scikit-learn/scikit-learn#13987, and specifically in data.py#L2232.

    Here's some of the traceback:

    self = <tests.preprocessing.test_data.TestQuantileTransformer object at 0x7ff5a0115860>
    output_distribution = 'uniform'
    
        @pytest.mark.parametrize("output_distribution", ["uniform", "normal"])
        def test_basic(self, output_distribution):
            rs = da.random.RandomState(0)
            a = dpp.QuantileTransformer(output_distribution=output_distribution)
            b = spp.QuantileTransformer(output_distribution=output_distribution)
        
            X = rs.uniform(size=(1000, 3), chunks=50)
    >       a.fit(X)
    
    tests/preprocessing/test_data.py:216: 
        def fit(self, X, y=None):
            ...
    
    >       X = self._check_inputs(X, copy=False)
    E       TypeError: _check_inputs() got an unexpected keyword argument 'copy'

    Dask-ML overwrites _check_inputs, so this version will need to have that keyword.

  4. stsievert commented on Jun 10, 2019

    @stsievert
    MemberAuthor

    Closed by #518

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions