FIGSRegressor failed to calculate importance_data_tree
jckkvs opened this issue · comments
The following code snippet results in an error.
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
This error is caused by the following implementations:
Line 342 in 5935361
Line 347 in 5935361
value_counts[0.0]
and value_counts[1.0]
are code assuming Classifier and do not work with Regressor.