-
Notifications
You must be signed in to change notification settings - Fork 24
Passive Learning of Stochastic Automata
Alergia (and its input-output variant IOAlergia) is a passive automata learning algorithms suited for learning Markov Chains and Markov decision processes.
Following paper describes both algorithms and served as basis for our implementation.
Alergia is a passive algorithm, meaning that it will learn the automaton that conforms to the provided data. In this section, we will show the how to preprocess data so that it can be used with our implementation.
AALpy has several most often used functions that process data from files, so that the data can be used for Algeria.
Input data for Markov Chain(MC) learning is a list of sequences over which MC will be constructed.
Algorithm dictates that all sequences should start with the same symbol.
Note that all sequences should start with the same element. To learn MC with AALpy, pass the data in the following format (list of lists of symbols):
[(Input*)*]; eg. [[1,2,3],[1,3],[1,2,3,4],...]
HINT: If not all entries in your data start with the same symbol, prepend them with a placeholder start symbol, such as '$'
Input data for Markov Decision Process(MDP) learning is a list of input-output sequences.
Algorithm dictates that all sequences should start with the same output symbol, followed by input-output pairs.
Note that all sequences should start with the same element. If that is not the case for your data, simply prepend them with some placeholder symbol. To learn MDPs with AALpy, pass the data in the following format:
[[Output, (Input, Output)*]*]; eg. [[O, (I,O), (I,O)], [O, (I1,O2),...))]]
NOTE: In each entry, first element is an output, followed by input-output tuples. If input-output pairs are not in tuples, IOAlergia will throw an error.
NOTE: This format is also used when learning deterministic Moore machines.
Experimental new feature is the passive learning of Stochastic Mealy Machines. For the most part learned models are as accurate or sightly less accurate if the underlying system behaves like the MDP, but more accurate if the underlying system has an SMM-like structure (many input/output pairs from the same state).
To learn SMMs with AALpy, pass the data in the following format:
[[(Input, Output)*]*]; eg. [[(I,O), (I,O)], [(I1,O2),...))]]