seismometer.seismogram.Seismogram¶
- class seismometer.seismogram.Seismogram(*args, **kwargs)¶
Seismogram is the main orchestrator for the seismometer package. It loads the model data and configuration metadata. It is a singleton, so only one instance can be created.
- Seismogram is responsible for:
- Loading static data so that they can be treated as Immutable.
Model Configuration
Source Data
- Hold the current dynamic configuration that is shared state.
Cohort Selection
- Providing data access for other objects without compromising the source data.
Merge Event data with Prediction data for Label generation
Cohort based data selection
Model configuration help texts
As a single instance, the first time it is loaded, it will load the data from the configuration. In order to refresh the single instance, the kernel must be restarted, or Seismogram.kill() must be called.
- __init__(config, dataloader)¶
Constructor for Seismogram, which can only be instantiated once.
Subsequent calls will get the initial instance.
- Parameters:
config (ConfigProvider) – The configuration provider instance.
dataloader (SeismogramLoader, optional) – A loader instance for defining the data loading pipeline.
Methods
__init__
(config, dataloader)Constructor for Seismogram, which can only be instantiated once.
copy_config_metadata
()Loads the base configuration and alerting configuration.
Creates data columns for each cohort defined in configuration.
event_aggregation_method
(event_col)Gets the strategy for aggregating scores with respect to the specified event.
event_aggregation_window_hours
(event_col)Gets the window in hours for aggregating scores with respect to the specified event.
event_merge_strategy
(event_col)Gets the strategy for merging scores with respect to the specified event.
load_data
(*[, predictions, events, reset])Loads the seismogram data.
Updates the active values for notebook-scoped selections.
Attributes
Minimum number of observations for a cohort to be included.
Number of unique cohort attributes by usage definition.
comparison_time
Column name specifying which time to use as reference when analyzing interventions and outcomes.
The working dataframe core to the analyses.
Latest prediction time.
Number of unique prediction entities in the data.
Number of unique outcome KPIs in the data.
DataFrame of events which include the target event and other outcomes.
Event descriptions.
Number of features in the data.
intervention
First event's name in configuration with usage 'intervention'.
outcome
First event's name in configuration with usage 'outcome'.
The first configured model output (score).
The location to write output files.
Number of predictions in the data.
Earliest prediction time.
Name of the target.
List of target descriptors, the display name of the event type, for targets.
Name of the target event.
The time associated with the primary target event.
entity_keys
The one or two columns used as identifiers for data.
predict_time
The column name for evaluation timestamp.
output_list
The list of columns representing model outputs.