[ENH] CN2 Rules: prefer equality (with optional restriction) for categorical variables#7128
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7128 +/- ##
=======================================
Coverage 88.77% 88.77%
=======================================
Files 334 334
Lines 73671 73695 +24
=======================================
+ Hits 65402 65425 +23
- Misses 8269 8270 +1 🚀 New features to boost your workflow:
|
3d3209c to
db3d9a2
Compare
|
Some tests are in |
|
I think I may have a more elegant solution to the original problem. When the best rule among a set of rules is chosen, it is, among the ones with the same quality score, always the first. Now, if we just change the rule generation order... Currently it loops per value, and then per operator. If we change it to loop per operator and then per value, the selection algorithm downstream will prefer the This approach gives the same result for the The bad thing is that this approach it is not backward compatible (different rules would be induced with the same settings). |
|
Thanks for a great find. I'd keep both.
|
I also don't think compatibility is an issue here. |
Issue
Fixes #7120.
Description of changes
I haven't written any tests -- because there are none so far, so I would consider this as a separate project.
As for documentation: can do, but after we agree about this PR.
Includes