Closed Wan-xiaohui closed 1 year ago
Thanks for raising this issue! Will look into it...
I believeI just updated the code (+bumped the version of imodels) to fix this issue: should work once you run pip install --upgrade imodels
.
Best, Chandan
I believeI just updated the code (+bumped the version of imodels) to fix this issue: should work once you run
pip install --upgrade imodels
.Best, Chandan
Thanks, it solved my problem !
Hi,
When I use the BoostedRulesClassifier, it sometimes throws an exception as follows:
This BoostedRulesClassifier instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.
I find that the exception results from the implementation of the class RuleSet: ` def _eval_weighted_rule_sum(self, X) -> np.ndarray:
Specifically, when the computer runs the
check_is_fitted(self,
['rules_without_featurenames', 'nfeatures','feature_placeholders'])
, it finds that self.rules_without_featurenames does not exist, so the computer throws the above exception.And I further review my code and data set, I find that my training set is easy to train a classifier, so the training error of the estimator is close to zero, it may result in a bug in the fit function of the class BoostedRulesClassifier: ` for _ in range(self.n_estimators):
Fit a classifier with the specific weights
` Because the error_m is zero, so it directly returns self without executing subsequent statements, in such a case, self.rules_without_featurenames dose not exist.
My current solution to this bug is to modify the following code fragment in the fit function of the class BoostedRulesClassifier: `
Error
` I'm not sure whether it may introduce new defects, but it indeed solves the exception.