seismometer.configuration.config.ConfigProvider¶
- class seismometer.configuration.config.ConfigProvider(config_config, *, usage_config=None, automation_config=None, info_dir=None, data_dir=None, template_notebook=None, definitions=None, output_path=None)¶
The base configuration provider.
The configuration provider is a layer between the configuration data model and the consuming class. It is responsible for loading the config files, template notebook, and data and streamlining the access across multiple files.
- Parameters:
config_config (str | Path) – Specifies the path to the primary configuration file with a top level key of “other_info”. The primary configuration file is largely focused on describing where to find other pieces and includes several file names and paths.
usage_config (Optional[str] | Path, optional) – Specifies the path to the usage configuration file with a top level key of “data_usage”, by default None; it uses usage_config from the primary config file, which specifies details about what kind of data is used and how it should be used.
info_dir (Optional[str | Path], optional) – Specifies the path to the information directory. Not used, by default None; Configured in the primary config file
data_dir (Optional[str | Path], optional) – Specifies the path to the data directory, by default None; it uses data_dir from the primary config file, which is where data dictionaries are written/read.
template_notebook (Optional[object], optional) – Unused.
definitions (Optional[dict], optional) – A dictionary of definitions to use instead of loading those specified by configuration, by default None.
output_path (Optional[str | Path], optional) – Specifies the path to the output directory or file, by default None; if a directory, the template notebook will be used with the prefix gen.
automation_config (str | Path)
- __init__(config_config, *, usage_config=None, automation_config=None, info_dir=None, data_dir=None, template_notebook=None, definitions=None, output_path=None)¶
- Parameters:
config_config (str | Path)
usage_config (str | Path)
automation_config (str | Path)
info_dir (str | Path)
data_dir (str | Path)
template_notebook (object)
definitions (dict)
output_path (str | Path)
Methods
__init__(config_config, *[, usage_config, ...])event_group(usage_group)Returns a dictionary of events indexed by column name and restricted to the specified usage group
event_types()List of all event types referenced in usage configuration.
set_output(output[, nb_prefix])Resolves the location of the outputs based on config and specified values.
Attributes
automation_configautomation_config_pathcensor_min_countThe minimum count needed for a cohort to be included in analysis.
cohort_hierarchiesOrdered lists of cohort columns representing configured hierarchies.
cohortsList of cohort objects to use during analysis.
comparison_timeThe column name of the timestamp to use as reference for comparison across events.
configThe configuration definition.
context_idAccessor for the context_id key.
data_dirThe parent directory for data files.
entity_idAccessor for the entity_id key.
entity_keysList of entity and context ids.
ev_timeThe time column in the event table.
ev_typeThe type column in the event table.
ev_valueThe value column in the event table.
event_defsThe dictionary for event data.
event_pathThe path to the event data file.
eventsDictionary of all event objects indexed by column name.
featuresAn explicit list of features to use in analysis.
info_dirThe directory for output information.
interventionsDictionary of events to use as interventions, keyed off of event name.
metadata_pathThe path to the metadata json.
metric_configmetric_groupsCollection of metrics that are members of each metric group.
metric_typesCollection of the metric type associated with each metric.
metricsCollection of metric objects to use during analysis.
outcomesDictionary of events to use as outcomes, keyed off of event name.
outputThe primary output of the model.
output_dirThe directory for output files.
output_listThe list of all columns to consider as outputs.
output_notebookThe name of the output notebook.
predict_timeThe time column for predictions.
prediction_columnsList of all columns referenced in usage configuration.
prediction_defsThe dictionary for data in the prediction frame.
prediction_pathThe path to the prediction data file.
prediction_typesGathers the defined types from the configuration dictionary.
targetThe primary target to use during evaluation.
targetsDictionary of events to use as targets, keyed off of event name.
templateThe template used for building a model-specific seismograph notebook.
usageThe configuration on data usage.