from imodels import FIGSRegressor
from sklearn.datasets import make_regression
X,y = make_regression(n_features=10)
figs = FIGSRegressor()
figs.fit(X,y)
The error
C:\Users\user\Anaconda3\envs\py310\lib\site-packages\imodels\tree\figs.py:377: RuntimeWarning: invalid value encountered in divide
importance_data_tree /= tree_samples
The following code snippet results in an error.
The error
This error is caused by the following implementations: https://github.com/csinva/imodels/blob/59353613dc1f456ba243112d9e6b8f313180da18/imodels/tree/figs.py#L342 https://github.com/csinva/imodels/blob/59353613dc1f456ba243112d9e6b8f313180da18/imodels/tree/figs.py#L347
value_counts[0.0]
andvalue_counts[1.0]
are code assuming Classifier and do not work with Regressor.