pub struct BayesianNetworkState {
pub order: Vec<usize>,
pub parents: Vec<Vec<usize>>,
pub cpt: Vec<Vec<f32>>,
}Expand description
Fitted state for the BayesianNetwork model after one call to
ProbabilityModel::fit.
On the prior path (prev = None) the network is edgeless: order is the
natural order [0, 1, …, D-1], every parents[v] is empty, and every
cpt[v] is the single-entry vector [init_prob].
Fields§
§order: Vec<usize>Topological sampling order: a permutation of 0..D such that every
node appears after all of its parents. Ancestral sampling walks this
order so each gene’s parents are already drawn.
parents: Vec<Vec<usize>>parents[node] is the node’s parent index set, kept sorted ascending.
The sort defines the bit positions used by the CPT packing (see the
module docs).
cpt: Vec<Vec<f32>>Conditional probability tables: cpt[node][config] is
P(node = 1 | parents = config), where config is the bit-packed
parent configuration Σ_j bit(parent_j) << j over parents[node] in
sorted order. Each inner vector has length 2^|parents[node]|.
Trait Implementations§
Source§impl Clone for BayesianNetworkState
impl Clone for BayesianNetworkState
Source§fn clone(&self) -> BayesianNetworkState
fn clone(&self) -> BayesianNetworkState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BayesianNetworkState
impl RefUnwindSafe for BayesianNetworkState
impl Send for BayesianNetworkState
impl Sync for BayesianNetworkState
impl Unpin for BayesianNetworkState
impl UnsafeUnpin for BayesianNetworkState
impl UnwindSafe for BayesianNetworkState
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
Source§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more