Skip to content

model

Local, stateless prediction with learned AALpy automata.

RPNIMealyModel(automaton, *, input_name, input_type, output_name, output_type)

Bases: _RPNIModel[MealyMachine]

A Flowcean model wrapping an AALpy Mealy machine by composition.

Predictions require the training input column's name and scalar dtype. They have the training output column's name and scalar dtype, with one list of output symbols per input trace. An empty input word produces an empty output word. Undefined transitions raise ValueError; no completion is invented.

Source code in src/flowcean/aalpy/model.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def __init__(
    self,
    automaton: Automaton,
    *,
    input_name: str,
    input_type: pl.DataType,
    output_name: str,
    output_type: pl.DataType,
) -> None:
    self._automaton = automaton
    self._input_name = input_name
    self._input_type = input_type
    self._output_name = output_name
    self._output_type = output_type

RPNIMooreModel(automaton, *, input_name, input_type, output_name, output_type)

Bases: _RPNIModel[MooreMachine]

A Flowcean model wrapping an AALpy Moore machine by composition.

Predictions require the training input column's name and scalar dtype. They have the training output column's name and scalar dtype, with one list of output symbols per input trace. Every output word starts with the initial-state output, even for empty input words. Undefined transitions raise ValueError.

Source code in src/flowcean/aalpy/model.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def __init__(
    self,
    automaton: Automaton,
    *,
    input_name: str,
    input_type: pl.DataType,
    output_name: str,
    output_type: pl.DataType,
) -> None:
    self._automaton = automaton
    self._input_name = input_name
    self._input_type = input_type
    self._output_name = output_name
    self._output_type = output_type