Model
EventModel
build
classmethod
build(
preproc: EventPreproc,
size: str | Size | TabularModelSize,
block: str | BlockType = ATTN,
dropout: float | None = 0.12,
) -> EventModel
Event model to generate synthetic event data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preproc
|
EventPreproc
|
An |
required |
size
|
str | Size | TabularModelSize
|
The size configuration of the model. Could be either a |
required |
block
|
str | BlockType
|
The block type. The possible values depend on whether the data is single table or multi table. For a single table, either 'free' (default), 'causal', or 'lstm'. For multi table data, either 'free' (default) or 'lstm'. |
ATTN
|
dropout
|
float | None
|
The dropout probability. |
0.12
|
Returns:
Type | Description |
---|---|
EventModel
|
An |
generate
generate(
n_samples: int | None = None,
ctx: dict[str, DataFrame] | None = None,
max_n_events: int = 0,
forbidden_events: Iterable[str] = (),
force_final: bool = False,
force_event: bool = False,
batch_size: int = 0,
temp: float = 1.0,
) -> RelationalData
Generate synthetic event data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_samples
|
int | None
|
Desired number of samples in the root table. Must be given if and only if |
None
|
ctx
|
dict[str, DataFrame] | None
|
The context from where to start a conditional generation. If provided, |
None
|
max_n_events
|
int
|
Maximum number of events for each row of the root table. If 0, no limit is enforced. |
0
|
forbidden_events
|
Iterable[str]
|
The tables containing events that should not be generated. May contain both final and non-final events. |
()
|
force_final
|
bool
|
Whether to force the generation to end with a final table. |
False
|
force_event
|
bool
|
Whether to force the generation of non-final events, until the max number of events is reached.
If True, the parameter |
False
|
batch_size
|
int
|
Batch size used during generation. If 0, all data is generated in a single batch. |
0
|
temp
|
float
|
Temperature parameter for sampling. |
1.0
|
Returns:
Type | Description |
---|---|
RelationalData
|
A |
save
load
classmethod
load(path: Path | str) -> EventModel
Load the EventModel
from the checkpoint at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
Path | str
|
The path to the loaded checkpoint. |
required |
Returns:
Type | Description |
---|---|
EventModel
|
The loaded |