csinva / imodels

Interpretable ML package 🔍 for concise, transparent, and accurate predictive modeling (sklearn-compatible).
https://csinva.io/imodels
MIT License
1.34k stars 119 forks source link

Problem importing functions from module `imodels.importance` #185

Closed facusapienza21 closed 11 months ago

facusapienza21 commented 11 months ago

Hi!

I was trying to run some of the examples in the mdi+ demo (thanks @tiffanymtang for the reference!), but I notice the imports of the module don't work:

from imodels.importance import RandomForestPlusRegressor, RandomForestPlusClassifier, \
    RidgeRegressorPPM, LassoRegressorPPM, IdentityTransformer
from imodels.importance.rf_plus import _fast_r2_score

I checked and it seems that the __init__.py present in the last release of the package doesn't include the respective includes. This is what is present in the __init__.py of the last install:

"""
Feature importance methods for black box models
"""

from .representation import TreeTransformer
from .r2f import R2F

while the right content should be what is currently in the repository init file.

I was able to run the example by installing directly from the repository, but I thought it may be worth reporting this since other users may encounter the same issue!

tiffanymtang commented 11 months ago

@facusapienza21 Thanks for making note of this! @csinva I'm not sure how you prefer to manage new releases of imodels, but please let me know if there's anything you need from me with the MDI+ additions. Thanks both!

csinva commented 11 months ago

Ah thanks both for pointing this out! Just bumped the version that includes the updated init file, so should work smoothly now :)