muellerzr / fastinference

A collection of inference modules for fastai2
https://muellerzr.github.io/fastinference
Apache License 2.0
89 stars 16 forks source link

Error importing interpretation module #46

Open ecatkins opened 3 years ago

ecatkins commented 3 years ago

It appears this is being triggered where get_features_core is being passed to the delegates decorator. I switched out get_features_core for TabularLearner.get_features_core, and this resolved the immediate error, but seemed to cause issues further downstream.

I don't know enough about the fastcore or fastinference libraries, to understand the desired behavior here

>>> from fastinference.tabular.interpretation import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/python3.8/site-packages/fastinference/tabular/interpretation.py", line 138, in <module>
    def get_top_features_corr(x:TabularLearner, df:Optional[pd.DataFrame]=None, thresh:float=0.8, **kwargs):
  File "/lib/python3.8/site-packages/fastcore/meta.py", line 111, in _f
    if to is None: to_f,from_f = f.__base__.__init__,f.__init__
AttributeError: 'function' object has no attribute '__base__'