pub struct PredictionModel {
pub model_type: PredictionModelType,
pub transitions: TransitionMatrix,
pub higher_order: HigherOrderTransitions,
pub start_activities: HashMap<String, u64>,
pub end_activities: HashMap<String, u64>,
pub vocabulary: Vec<String>,
pub trace_count: u64,
pub event_count: u64,
}Expand description
A trained prediction model.
Fields§
§model_type: PredictionModelTypeModel type.
transitions: TransitionMatrixFirst-order transitions (activity -> next -> count).
higher_order: HigherOrderTransitionsHigher-order transitions (for Markov2 and N-gram).
start_activities: HashMap<String, u64>Start activity frequencies.
end_activities: HashMap<String, u64>End activity frequencies.
vocabulary: Vec<String>Activity vocabulary.
trace_count: u64Total traces trained on.
event_count: u64Total events trained on.
Implementations§
Source§impl PredictionModel
impl PredictionModel
Sourcepub fn train(log: &EventLog, config: &PredictionConfig) -> Self
pub fn train(log: &EventLog, config: &PredictionConfig) -> Self
Create a new model from an event log.
Sourcepub fn predict(
&self,
history: &[String],
config: &PredictionConfig,
) -> Vec<ActivityPrediction>
pub fn predict( &self, history: &[String], config: &PredictionConfig, ) -> Vec<ActivityPrediction>
Predict next activities for a given sequence.
Sourcepub fn predict_from_names(
&self,
history: &[&str],
config: &PredictionConfig,
) -> Vec<ActivityPrediction>
pub fn predict_from_names( &self, history: &[&str], config: &PredictionConfig, ) -> Vec<ActivityPrediction>
Predict from activity names (convenience method).
Trait Implementations§
Source§impl Clone for PredictionModel
impl Clone for PredictionModel
Source§fn clone(&self) -> PredictionModel
fn clone(&self) -> PredictionModel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PredictionModel
impl Debug for PredictionModel
Source§impl Default for PredictionModel
impl Default for PredictionModel
Source§impl<'de> Deserialize<'de> for PredictionModel
impl<'de> Deserialize<'de> for PredictionModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PredictionModel
impl RefUnwindSafe for PredictionModel
impl Send for PredictionModel
impl Sync for PredictionModel
impl Unpin for PredictionModel
impl UnwindSafe for PredictionModel
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.