sorgerlab / indra

INDRA (Integrated Network and Dynamical Reasoning Assembler) is an automated model assembly system interfacing with NLP systems and databases to collect knowledge, and through a process of assembly, produce causal graphs and dynamical models.
http://indra.bio
BSD 2-Clause "Simplified" License
177 stars 68 forks source link

Fix feature matrix generation in CountsScorer when not including supports evidences #1317

Closed johnbachman closed 3 years ago

johnbachman commented 3 years ago

There was a bug in #1295 where setting include_more_specific=False in CountsScorer led to an error in subsequent use of the scorer to when called with BeliefEngine.set_hierarchy_probs. Where the statement feature matrix should have simply ignored any evidences from more specific statements it was instead expanding the feature matrix with additional columns which then did not match the trained classifier within the CountsScorer.

This PR adds a fix and a regression test for this error.