pub struct HiddenMarkov { /* private fields */ }Expand description
Specialized structure for Hidden Markov Model of order 1 The states are identified by ids taken from natural numbers.
Implementations§
Source§impl HiddenMarkov
impl HiddenMarkov
Sourcepub fn new(
initials: Vec<f64>,
transitions: Vec<Vec<f64>>,
observation_model: Vec<Vec<f64>>,
) -> Option<HiddenMarkov>
pub fn new( initials: Vec<f64>, transitions: Vec<Vec<f64>>, observation_model: Vec<Vec<f64>>, ) -> Option<HiddenMarkov>
Create a new Hidden Markov Model Please note that:
- initials should have more then 1 state. Its values should be positive
- transitions should have exactly #state x #state elements. Values positive
- observation_model should have #state x #outcomes elements. Values positive
Params:
- initials - Initial probability for each state
- transition - Probability of changing state from x_1 to x_2 (state x state)
- observation_matrix - Probability of generating outcome in each state (state x outcome)
Observation Vec should:
- Have at least 1 observation
- Each LabelId should be less then maximum number of observation in HMM model
Auto Trait Implementations§
impl Freeze for HiddenMarkov
impl RefUnwindSafe for HiddenMarkov
impl Send for HiddenMarkov
impl Sync for HiddenMarkov
impl Unpin for HiddenMarkov
impl UnwindSafe for HiddenMarkov
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