Source code for traveltimes_prediction.configs.sections_settings

"""
Module *section_settings*.

Contains settings for all used sections, list of sections which should be maintained and definitions of sensors.

Settings of sections are in ``sections_settings`` constant. For each section, multiple attributes has to be specified as follows:

* Input sensors - list of sensors, which are at the beginning of the section.
* Output sensors - list of sensors that are at the end of the section.
* Inner sensors - list of sensor groups, which are between Input and Output. Each group of sensors is located at one slice.
* Forbidden models - set of model classes, that are not used for creation of the models of section.
* Models` config - configurations of the models (dicts)
* Sensor types - types of sensors that are used on this section.
* Timezone - timezone of section -> e.g. 'Europe/Prague', 'Europe/London' and others.

Sensors` names per each ``SENSOR_TYPE`` are defined  in constant ``sensors``.
"""

from ..models import ClusterModel, TimeDomainModel, CombinedModel
from ..models.algorithms import LinearRegressionWrapper, RidgeWrapper, MBKMeansWrapper, ElasticNetWrapper


[docs]class SENSOR_TYPE: """ Class that defines the sensors` types. """ SENSOR_DET1 = 'det1' SENSOR_DET2 = 'det2'
sections_settings = {'TEST-TEST': {'input_sensors': ['26'], 'output_sensors': ['59'], 'inner_sensors': [('11', ), ('20', ), ('47', ), ('24', ), ('15', ), ('02', )], 'forbidden_models': set(), 'models_config':[{'model': TimeDomainModel, 'model_params': {'regressor': RidgeWrapper, 'regressor_params': {'alpha': 1000, 'tol': 50}}}, {'model': ClusterModel, 'model_params': {'clusterizer': MBKMeansWrapper, 'clusterizer_params': {'n_clusters': 5}, 'regressor': ElasticNetWrapper, 'regressor_params': {'alpha': 1, 'l1_ratio': 0.9}}}, {'model': CombinedModel, 'model_params': {'models': {'T1': TimeDomainModel, 'C1': ClusterModel}, 'models_params': { 'T1': {'regressor': RidgeWrapper, 'regressor_params': {'alpha': 1000, 'tol': 50}}, 'C1': {'regressor': LinearRegressionWrapper, 'regressor_params': {}, 'clusterizer': MBKMeansWrapper, 'clusterizer_params': { 'n_clusters': 1}}, }}} ], 'sensor_types': [SENSOR_TYPE.SENSOR_DET1, SENSOR_TYPE.SENSOR_DET2], 'timezone': 'America/Vancouver' }, } sensors = \ { SENSOR_TYPE.SENSOR_DET1: {'47', '11', '20', '24'}, SENSOR_TYPE.SENSOR_DET2: {'15', '26', '02', '59'}, } #: List of sections that should be maintained sections_to_maintain = ['TEST-TEST']