Comments (10)
Hi @anindya5 --
This appears to be a question that's better suited for the interpret-community repo. Transferring it there so they can help you.
-InterpretML
from interpret-community.
from interpret-community.
@anindya5 strange, can you do the import manually in your python environment?
from lightgbm import LGBMRegressor, LGBMClassifier, Booster
init_func = LGBMRegressor
Perhaps the import errors are getting suppressed here, do you see anything printed:
with warnings.catch_warnings():
warnings.filterwarnings('ignore', 'Starting from version 2.2.1', UserWarning)
import shap
try:
from lightgbm import LGBMRegressor, LGBMClassifier, Booster
import lightgbm
if (version.parse(lightgbm.__version__) <= version.parse('2.2.1')):
print("Using older than supported version of lightgbm, please upgrade to version greater than 2.2.1")
except ImportError:
print("Could not import lightgbm, required if using LGBMExplainableModel")
from interpret-community.
@anindya5 is this issue resolved? Are you able to proceed?
Regards
from interpret-community.
@anindya5, closing this issue since there is no response on this thread. Please feel free to reopen if you continue to run into this error.
Regards
from interpret-community.
Still seeing this issue ? Does anyone has any resolution ?
from interpret-community.
@nayanaramakanth Sorry about the issue you are having. Do you have lightgbm package installed in your environment? Can you show the output of:
pip show lightgbm
Specifically what version of lightgbm you have?
from interpret-community.
Hi,
I'm having the same problem. In my case I'm following this AzureML tutorial.
https://docs.microsoft.com/en-us/azure/machine-learning/how-to-machine-learning-interpretability
And when I try to execute this part:
from interpret.ext.blackbox import MimicExplainer
from lightgbm import LGBMRegressor, LGBMClassifier, Booster
init_func = LGBMRegressor
# you can use one of the following four interpretable models as a global surrogate to the black box model
from interpret.ext.glassbox import LGBMExplainableModel
from interpret.ext.glassbox import LinearExplainableModel
from interpret.ext.glassbox import SGDExplainableModel
from interpret.ext.glassbox import DecisionTreeExplainableModel
# "features" and "classes" fields are optional
# augment_data is optional and if true, oversamples the initialization examples to improve surrogate model accuracy to fit original model. Useful for high-dimensional data where the number of rows is less than the number of columns.
# max_num_of_augmentations is optional and defines max number of times we can increase the input data size.
# LGBMExplainableModel can be replaced with LinearExplainableModel, SGDExplainableModel, or DecisionTreeExplainableModel
explainer2 = MimicExplainer(model,
x_train,
LGBMExplainableModel,
augment_data=True,
max_num_of_augmentations=10,
features=breast_cancer_data.feature_names,
classes=classes)_
I have the commented error
C:\ProgramData\Anaconda3\lib\site-packages\interpret_community\mimic\models\lightgbm_model.py in __init__(self, multiclass, random_state, shap_values_output, classification, **kwargs)
173 initializer = LGBMClassifier
174 else:
--> 175 initializer = LGBMRegressor
176 self._lgbm = initializer(random_state=random_state, **initializer_args)
177 super(LGBMExplainableModel, self).__init__(**kwargs)
NameError: name 'LGBMRegressor' is not defined_
Here is the result of "pip show lightgbm"
Name: lightgbm
Version: 3.3.2
Summary: LightGBM Python Package
Home-page: https://github.com/microsoft/LightGBM
Author: None
Author-email: None
License: The MIT License (Microsoft)
Location: c:\programdata\anaconda3\lib\site-packages
Requires: numpy, scipy, wheel, scikit-learn
Required-by:
Thanks in advance for your support
from interpret-community.
Hi @nayanaramakanth can you help with this, thanks in advance....
from interpret-community.
@rnavarromatesanz
can you try doing an import in your python environment manually, eg:
from lightgbm import LGBMRegressor, LGBMClassifier, Booster
this error indicates that this import is just not working for some reason
from interpret-community.
Related Issues (20)
- ImportError: cannot import name 'TabularExplainer' HOT 3
- Issue when initializing explainer through TabularExplainer and KernelExplainer HOT 1
- Log scale combo box for Dependence plot's x axis HOT 2
- Replace load_boston with alternate regression dataset
- 'Expecting data to be a DMatrix object, got: ', <class 'pandas.core.frame.DataFrame'> HOT 7
- Question. How is the global explanation measured? HOT 7
- Question. How good is my surrogate model? HOT 8
- Explainers do not work with Keras models with multiple inputs HOT 10
- Calculate r2_score for PFIExplainer HOT 6
- Interpret explainer module question HOT 7
- Code Formatting Standards HOT 5
- TabularExplainer doesn't work with bias-mitigated model from fairlearn HOT 5
- How can I use MimicExplainer with Voting Classifier? [Question] HOT 5
- Dimension errors when using sklearn OneHotEncoder with min_frequency parameter HOT 1
- How can I get the data points of Aggregate feature importance ?
- Converting from NumPy array to list in mimic_explainer.py:_save()
- cannot import MimicExplainer HOT 7
- package `interpret-community` is incompatible with current `shap` version
- Getting <AttributeError: 'DynamicGlobalExplanation' object has no attribute 'get_ranked_per_class_names'> when running PFIExplainer
- Allow Pandas 2 in setup.py HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interpret-community.