Learn R Programming

nfer (version 1.1.3)

learn: Learn an nfer specification from an event trace.

Description

This function applies the nfer mining algorithm to a trace to attempt to learn a specification. It will only learn before rules and will only find those when there is periodic behavior in the trace. This works best for system traces of real-time systems where events represent scheduled, periodic behavior. At this time, only the event names will be considered while any data is ignored.

Usage

learn(events, loglevel = 0)

Value

A handle to a learned nfer specification, loaded into R.

Arguments

events

The dataframe containing events.

loglevel

(Optional) The logging level to set (0-4), where 0 is only warnings and errors and 3 is debug. Default is 0.

Details

Event traces are passed as dataframes with at least two columns. The first two columns contain event names and timestamps, respectively. Names should be strings. Timestamps should be integers or strings, ideally, but may be numeric. Subsequent columns will be ignored by this function, for now.

Example dataframe events:


| name | timestamp | x |    y |
-------------------------------
| foo  | 123       | 2 | NA   |
| bar  | 987       | 3 | TRUE |

Examples

Run this code
events <- nfer::read(system.file("extdata", "qnx.events", package = "nfer"))
learned <- nfer::learn(events)
learned <- nfer::learn(events, loglevel=1)

Run the code above in your browser using DataLab