pgmpy icon indicating copy to clipboard operation
pgmpy copied to clipboard

Add root_nodes parameter to ExpertKnowledge

Open MAVRICK-1 opened this issue 1 month ago • 6 comments

  • 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

MAVRICK-1 avatar Nov 19 '25 19:11 MAVRICK-1

cc @ankurankan

MAVRICK-1 avatar Nov 19 '25 19:11 MAVRICK-1

@MAVRICK-1 Thanks for the PR. The tests seem to be failing, could you please have a look?

ankurankan avatar Nov 20 '25 16:11 ankurankan

Its minor issue solving it

MAVRICK-1 avatar Nov 21 '25 12:11 MAVRICK-1

@ankurankan all test passed

MAVRICK-1 avatar Nov 21 '25 14:11 MAVRICK-1

@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.

MAVRICK-1 avatar Dec 09 '25 12:12 MAVRICK-1

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

Impacted file tree graph

@@            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:

codecov[bot] avatar Dec 11 '25 22:12 codecov[bot]