pub struct BayesianEngine { /* private fields */ }Expand description
Bayesian Network Engine
Implementations§
Source§impl BayesianEngine
impl BayesianEngine
Sourcepub fn new(config: BayesianConfig) -> Result<Self, String>
pub fn new(config: BayesianConfig) -> Result<Self, String>
Sourcepub fn query(&self, target: &str) -> Result<VariableResult, String>
pub fn query(&self, target: &str) -> Result<VariableResult, String>
Query the marginal probability of a variable
§Errors
Returns an error if the target variable is not found in the network.
Sourcepub fn query_with_evidence(
&self,
target: &str,
evidence: &HashMap<String, &str>,
) -> Result<VariableResult, String>
pub fn query_with_evidence( &self, target: &str, evidence: &HashMap<String, &str>, ) -> Result<VariableResult, String>
Sourcepub fn query_all(&self) -> Result<BayesianResult, String>
pub fn query_all(&self) -> Result<BayesianResult, String>
Sourcepub fn query_all_with_evidence(
&self,
evidence: &HashMap<String, &str>,
) -> Result<BayesianResult, String>
pub fn query_all_with_evidence( &self, evidence: &HashMap<String, &str>, ) -> Result<BayesianResult, String>
Query all variables with evidence
§Errors
Returns an error if querying any variable fails or evidence is invalid.
Sourcepub fn most_likely_explanation(&self) -> Result<HashMap<String, String>, String>
pub fn most_likely_explanation(&self) -> Result<HashMap<String, String>, String>
Get the most likely explanation (MPE) for all variables
§Errors
Returns an error if querying any variable fails.
Sourcepub const fn config(&self) -> &BayesianConfig
pub const fn config(&self) -> &BayesianConfig
Get the configuration
Auto Trait Implementations§
impl Freeze for BayesianEngine
impl RefUnwindSafe for BayesianEngine
impl Send for BayesianEngine
impl Sync for BayesianEngine
impl Unpin for BayesianEngine
impl UnsafeUnpin for BayesianEngine
impl UnwindSafe for BayesianEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more