[scikit-learn] check_estimator _NotAnArray

Guillaume Lemaître g.lemaitre58 at gmail.com
Wed May 12 06:46:17 EDT 2021


Scikit-learn estimator should validate X and y. This validation will
convert the input X and y into a NumPy
array to do the numerical operation of the estimator. This check makes sure
that passing an array-like (but
not a NumPy array) is still working as passing an array. It basically
ensure that the validation under the hood
happen.

Some estimators are indeed not supporting such a protocol (e.g. Vectorizer)
and can skip the test.

On Wed, 12 May 2021 at 10:48, Sole Galli via scikit-learn <
scikit-learn at python.org> wrote:

> fyi, just posted a question in stackoverflow:
>
>
> https://stackoverflow.com/questions/67500110/what-is-the-check-transformer-data-not-an-array-test-from-sklearns-check-estima
>
> Are there any plans to expand the docs on the check_estimators test?
>
> it would be really helpful to have a general idea of why each test is
> important, and the consequences of failing this or that test. At least it
> would be useful for me :p
>
> Thank you!
>
> Sole
>
>
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Monday, May 10, 2021 3:28 PM, Sole Galli via scikit-learn <
> scikit-learn at python.org> wrote:
>
> Hello everyone,
>
> I am trying to get Feature-engine transformers pass the check_estimator
> tests and there is one test, that I am not too sure what it is intended for.
>
> The transformers fail the *check_transformer_data_not_an_array *because
> the input is a _NotAnArray class, and Feature-engine transformers don't
> like that.
>
> What is this check intended for? Is it to ensure compatibility with some
> other sklearn class? if yes, which ones?
>
> I would appreciate any info or links to docs/ issues.
>
> Thanks a lot!
>
> Sole
>
>
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>


-- 
Guillaume Lemaitre
Scikit-learn @ Inria Foundation
https://glemaitre.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/scikit-learn/attachments/20210512/3ba31605/attachment.html>


More information about the scikit-learn mailing list