Evalml: Text featurizer warning on evalml import

Created on 3 Aug 2020  ·  7Comments  ·  Source: alteryx/evalml

In each user_guide notebook - RTD produces a warning wherever evalml is first imported:

Example

The cause of this issue is get_importable_subclasses initializing every component.

bug

Most helpful comment

nlp-primitives 1.0 is out on pypi now and tensorflow is no longer a required dependency

All 7 comments

Repro

import evalml

Stack trace here.

Root cause

  • get_importable_subclasses tries to initialize every component
  • This runs at import-time because we use get_importable_subclasses to generate the static lists of estimators and components
  • The text featurizer currently raises a warning if no text column names are provided the constructor

Seems like we should do what we can to avoid raising warnings at import-time.

Ideas for a fix

  1. Update the lists generated by get_importable_subclasses to be generated at runtime, not at import-time. I.e. in component utils
def _all_estimators():
    return get_importable_subclasses(Estimator, used_in_automl=False)
...
  1. Ensure none of our components raise warnings if they're constructed with default arguments. Update TextFeaturizer to not raise this particular warning. Add unit test to check for no warnings.
  2. Update get_importable_subclasses to suppress any warnings coming from component initialization

I suggest we do items 1 and 2.

When #1022 was merged - the runtime warning was removed. However, I'm still seeing the following warning:

2020-08-11 12:17:34,559 featuretools - WARNING Featuretools failed to load plugin nlp_primitives from library nlp_primitives. For a full stack trace, set logging to debug.

@dsherry I'll put up the PR to do items 1 and 2 as you mentioned above but @eccabay has informed me that this warning is not coming from our side.

After discussing with @rwedge there seems to be two solutions to the above featuretools warning:

  1. use the beta pip dependency resolver

  2. featuretools is in the process of making tensorflow optional and can be done by EOD 8/12/2020

I suggest we wait for the new featuretools release and confirm if the warning is still an issue.

Thanks @jeremyliweishih ! I agree option 2 here is best for handling the featuretools warning.

That aside, my understanding is you're currently working on options 1 and 2 from my comment from last week, correct? I think both of those changes, particularly the first, will add value here.

nlp-primitives 1.0 is out on pypi now and tensorflow is no longer a required dependency

Confirmed that warning does not pop up with latest version of nlp-primitives. Thanks @rwedge! You can check here.

Awesome, thanks both!

Was this page helpful?
0 / 5 - 0 ratings