Add root_nodes parameter to ExpertKnowledge
- Added root_nodes parameter to ExpertKnowledge.init
- Implemented _add_root_nodes_forbidden_edges() to automatically convert root nodes to forbidden edges
- Updated apply_expert_knowledge() and limit_search_space() to process root nodes
- Added comprehensive documentation and examples
- Added test_root_nodes_single() and test_root_nodes_multiple() tests
Fixes https://github.com/pgmpy/pgmpy/issues/2407
cc @ankurankan
@MAVRICK-1 Thanks for the PR. The tests seem to be failing, could you please have a look?
Its minor issue solving it
@ankurankan all test passed
@ankurankan I will resolve everything in this PR, as well as the others, by the end of the week. My exams are currently going on.
Codecov Report
:x: Patch coverage is 94.28571% with 2 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 94.93%. Comparing base (0159c4a) to head (c3a358a).
:white_check_mark: All tests successful. No failed tests found.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| pgmpy/estimators/ExpertKnowledge.py | 87.50% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## dev #2423 +/- ##
==========================================
- Coverage 94.93% 94.93% -0.01%
==========================================
Files 183 183
Lines 24911 24944 +33
==========================================
+ Hits 23650 23681 +31
- Misses 1261 1263 +2
| Files with missing lines | Coverage Δ | |
|---|---|---|
| pgmpy/estimators/expert.py | 82.52% <100.00%> (+0.17%) |
:arrow_up: |
| pgmpy/tests/test_estimators/test_expert.py | 94.59% <100.00%> (+0.97%) |
:arrow_up: |
| pgmpy/estimators/ExpertKnowledge.py | 87.80% <87.50%> (-0.26%) |
:arrow_down: |