dm.models.open_detector package

Submodules

dm.models.open_detector.adapted_models module

Creates models for window opening detection.

dm.models.open_detector.adapted_models.filter_only_open(values, attr_name='value')

It gets events when a window was open.

Parameters
  • values – dictionary of values

  • attr_name – name of attribute

Returns

list of events when a window was open

dm.models.open_detector.adapted_models.prepare_adapted_data_co2(devs, cls, start, end, lat, lon, weather)

It creates a model on the basis of CO2 concentration.

Parameters
  • devs – list of devices

  • cls – list of clients

  • start – timestamp that denotes start of required time interval

  • end – timestamp that denotes end of required time interval

  • lat – latitude where data was gathered

  • lon – longitude where data was gathered

  • weather – object used to get information about weather

Returns

model on the basis of CO2 concentration

dm.models.open_detector.adapted_models.prepare_adapted_data_t_h(devs, cls, start, end, lat, lon, weather)

It creates a model on the basis of temperature and humidity.

Parameters
  • devs – list of devices

  • cls – list of clients

  • start – timestamp that denotes start of required time interval

  • end – timestamp that denotes end of required time interval

  • lat – latitude where data was gathered

  • lon – longitude where data was gathered

  • weather – object used to get information about weather

Returns

model on the basis of temperature and humidity

dm.models.open_detector.create_attrs module

Creates attributes used in models for window opening detector and predictor of optimal ventilation length.

class dm.models.open_detector.create_attrs.ColumnMapper

Bases: object

NO_EVENTS_RECORDS_CO2 = [('2018/10/08 00:07:30', 'nothing'), ('2018/10/08 00:55:30', 'nothing'), ('2018/10/08 23:20:30', 'nothing'), ('2018/10/09 10:21:30', 'nothing'), ('2018/10/09 11:10:00', 'nothing'), ('2018/10/09 14:13:00', 'nothing'), ('2018/10/09 22:51:00', 'nothing'), ('2018/10/09 22:55:30', 'nothing'), ('2018/10/11 13:48:30', 'nothing'), ('2018/10/11 19:07:30', 'nothing'), ('2018/10/07 09:01:00', 'nothing'), ('2018/10/07 16:18:30', 'nothing'), ('2018/10/08 20:41:30', 'nothing'), ('2018/10/08 20:57:00', 'nothing'), ('2018/10/10 22:58:30', 'nothing'), ('2018/10/10 23:13:00', 'nothing'), ('2018/10/11 13:47:30', 'nothing'), ('2018/10/16 17:02:30', 'nothing'), ('2018/10/17 10:51:30', 'nothing'), ('2018/10/18 19:56:30', 'nothing'), ('2018/10/07 08:58:00', 'nothing'), ('2018/10/07 11:36:00', 'nothing'), ('2018/10/08 19:20:00', 'nothing'), ('2018/10/09 22:28:00', 'nothing'), ('2018/10/11 18:51:30', 'nothing'), ('2018/10/13 13:25:30', 'nothing'), ('2018/10/13 18:31:30', 'nothing'), ('2018/10/14 00:40:00', 'nothing'), ('2018/10/14 09:08:30', 'nothing'), ('2018/10/14 18:41:30', 'nothing'), ('2018/10/09 10:44:30', 'nothing'), ('2018/10/14 22:28:00', 'nothing'), ('2018/10/16 21:08:00', 'nothing'), ('2018/10/17 10:47:30', 'nothing'), ('2018/10/17 23:51:00', 'nothing'), ('2018/10/18 20:07:00', 'nothing'), ('2018/10/19 07:04:30', 'nothing'), ('2018/10/19 10:52:30', 'nothing'), ('2018/10/21 20:28:00', 'nothing'), ('2018/10/22 15:00:30', 'nothing'), ('2018/10/09 10:45:30', 'nothing'), ('2018/10/15 00:26:00', 'nothing'), ('2018/10/19 07:06:00', 'nothing'), ('2018/10/22 12:33:00', 'nothing'), ('2018/10/22 16:39:30', 'nothing'), ('2018/10/28 08:04:00', 'nothing'), ('2018/10/28 15:39:30', 'nothing'), ('2018/10/31 00:15:00', 'nothing'), ('2018/10/31 23:35:00', 'nothing'), ('2018/11/02 20:30:00', 'nothing'), ('2018/10/07 11:42:00', 'nothing'), ('2018/10/15 23:49:30', 'nothing'), ('2018/10/16 21:16:00', 'nothing'), ('2018/10/18 20:08:00', 'nothing'), ('2018/10/24 05:33:00', 'nothing'), ('2018/10/31 07:24:30', 'nothing'), ('2018/11/10 05:04:00', 'nothing'), ('2018/11/10 06:37:30', 'nothing'), ('2018/11/10 23:22:00', 'nothing'), ('2019/01/29 23:06:00', 'nothing'), ('2018/10/17 12:36:30', 'nothing'), ('2018/10/19 10:52:30', 'nothing'), ('2018/11/10 03:05:30', 'nothing'), ('2018/11/10 06:38:00', 'nothing'), ('2018/11/20 18:23:00', 'nothing'), ('2018/11/24 07:35:00', 'nothing'), ('2018/12/01 04:33:00', 'nothing'), ('2019/01/08 03:18:30', 'nothing'), ('2019/01/08 14:42:30', 'nothing'), ('2019/01/09 15:47:30', 'nothing'), ('2018/10/18 20:06:00', 'nothing'), ('2018/10/22 16:39:30', 'nothing'), ('2018/10/24 05:32:30', 'nothing'), ('2018/11/05 18:02:30', 'nothing'), ('2018/11/10 03:04:30', 'nothing'), ('2018/11/10 03:59:30', 'nothing'), ('2018/11/10 04:12:00', 'nothing'), ('2018/11/10 04:56:30', 'nothing'), ('2018/11/10 05:03:30', 'nothing'), ('2018/11/10 06:37:00', 'nothing'), ('2018/10/14 00:01:30', 'nothing'), ('2018/10/14 14:59:00', 'nothing'), ('2018/10/21 20:27:30', 'nothing'), ('2018/10/23 18:24:30', 'nothing'), ('2018/10/31 07:16:30', 'nothing'), ('2018/11/08 12:23:30', 'nothing'), ('2018/11/09 23:29:30', 'nothing'), ('2018/11/10 03:08:30', 'nothing'), ('2018/11/10 23:25:00', 'nothing'), ('2018/11/16 11:54:00', 'nothing'), ('2018/11/10 02:30:30', 'nothing'), ('2019/01/10 09:38:00', 'nothing'), ('2019/01/15 15:10:30', 'nothing'), ('2019/01/18 09:59:00', 'nothing'), ('2019/01/28 04:39:30', 'nothing'), ('2018/10/17 12:36:00', 'nothing'), ('2018/10/17 12:36:30', 'nothing'), ('2018/10/31 07:17:00', 'nothing'), ('2018/10/31 07:17:30', 'nothing'), ('2018/11/09 23:27:30', 'nothing'), ('2018/10/14 18:47:00', 'nothing'), ('2018/10/17 12:36:00', 'nothing'), ('2018/11/09 23:28:30', 'nothing'), ('2018/11/11 01:07:00', 'nothing'), ('2018/11/11 01:07:30', 'nothing'), ('2018/11/11 01:08:00', 'nothing'), ('2018/11/10 04:23:00', 'nothing'), ('2019/01/18 09:59:00', 'nothing'), ('2019/01/31 03:53:00', 'nothing'), ('2018/10/31 07:16:30', 'nothing'), ('2018/11/10 23:14:00', 'nothing'), ('2019/01/18 09:59:00', 'nothing'), ('2018/10/10 20:59:30', 'nothing'), ('2018/10/14 22:55:30', 'nothing'), ('2018/10/15 13:53:30', 'nothing'), ('2018/10/16 21:33:30', 'nothing'), ('2018/10/17 15:18:30', 'nothing'), ('2018/10/19 13:51:00', 'nothing'), ('2018/10/20 16:40:30', 'nothing'), ('2018/10/20 19:09:30', 'nothing'), ('2018/10/21 02:55:30', 'nothing'), ('2018/10/21 04:44:30', 'nothing'), ('2018/10/22 16:39:30', 'nothing'), ('2018/10/24 21:52:00', 'nothing'), ('2018/11/10 02:02:30', 'nothing'), ('2018/11/10 04:26:00', 'nothing'), ('2018/11/11 23:13:00', 'nothing'), ('2018/12/01 23:26:30', 'nothing'), ('2019/01/10 08:51:30', 'nothing'), ('2019/01/12 10:45:00', 'nothing'), ('2019/01/24 12:30:30', 'nothing'), ('2019/01/26 15:36:30', 'nothing'), ('2018/10/24 03:21:30', 'nothing'), ('2018/10/24 03:22:00', 'nothing'), ('2018/12/02 21:14:00', 'nothing'), ('2018/12/06 17:45:00', 'nothing'), ('2019/01/15 15:11:00', 'nothing'), ('2019/01/28 04:27:30', 'nothing'), ('2018/10/08 02:17:30', 'nothing'), ('2018/10/09 01:28:30', 'nothing'), ('2018/10/09 23:40:30', 'nothing'), ('2018/10/13 17:27:00', 'nothing'), ('2018/10/18 07:17:30', 'nothing'), ('2018/10/19 01:51:30', 'nothing'), ('2018/10/19 02:53:00', 'nothing'), ('2018/10/19 05:26:30', 'nothing'), ('2018/10/22 12:40:00', 'nothing'), ('2018/10/24 01:16:00', 'nothing'), ('2018/10/24 04:25:00', 'nothing'), ('2018/10/24 04:57:30', 'nothing'), ('2018/10/24 06:55:30', 'nothing'), ('2018/10/27 13:23:00', 'nothing'), ('2018/11/01 19:35:00', 'nothing'), ('2018/11/03 12:29:00', 'nothing'), ('2018/11/10 00:46:30', 'nothing'), ('2018/11/10 05:01:00', 'nothing'), ('2018/11/14 02:25:00', 'nothing'), ('2018/11/23 13:49:30', 'nothing'), ('2018/10/09 09:17:00', 'nothing'), ('2018/10/10 11:56:00', 'nothing'), ('2018/10/15 13:20:00', 'nothing'), ('2018/10/24 03:21:30', 'nothing'), ('2018/10/31 07:17:00', 'nothing'), ('2018/11/03 01:26:30', 'nothing'), ('2018/11/08 19:15:00', 'nothing'), ('2018/11/11 01:06:30', 'nothing'), ('2018/11/24 02:54:30', 'nothing'), ('2018/11/24 07:20:30', 'nothing'), ('2018/10/07 09:00:30', 'nothing'), ('2018/10/07 11:36:30', 'nothing'), ('2018/10/11 18:47:30', 'nothing'), ('2018/10/11 20:56:30', 'nothing'), ('2018/10/11 21:00:00', 'nothing'), ('2018/10/13 11:11:00', 'nothing'), ('2018/10/13 13:32:00', 'nothing'), ('2018/10/14 10:54:30', 'nothing'), ('2018/10/14 15:01:30', 'nothing'), ('2018/10/14 18:45:30', 'nothing'), ('2018/10/22 16:40:00', 'nothing'), ('2018/10/24 03:21:00', 'nothing'), ('2018/10/24 05:02:00', 'nothing'), ('2018/10/28 09:39:30', 'nothing'), ('2018/10/28 13:02:30', 'nothing'), ('2018/11/09 23:06:30', 'nothing'), ('2018/11/24 04:01:00', 'nothing'), ('2018/11/24 07:20:00', 'nothing'), ('2018/12/08 06:11:30', 'nothing'), ('2018/12/09 04:44:30', 'nothing'), ('2018/10/07 11:35:30', 'nothing'), ('2018/10/15 13:14:30', 'nothing'), ('2018/10/19 06:52:00', 'nothing'), ('2018/10/31 07:16:00', 'nothing'), ('2018/11/09 22:01:30', 'nothing'), ('2018/11/09 23:14:30', 'nothing'), ('2018/11/10 02:28:30', 'nothing'), ('2018/11/10 03:04:00', 'nothing'), ('2018/11/13 14:39:00', 'nothing'), ('2018/11/24 04:02:30', 'nothing'), ('2018/10/15 13:14:00', 'nothing'), ('2018/10/15 13:20:30', 'nothing'), ('2018/10/19 14:40:30', 'nothing'), ('2018/10/19 17:54:00', 'nothing'), ('2018/10/19 18:39:30', 'nothing'), ('2018/10/19 21:47:30', 'nothing'), ('2018/10/19 22:20:30', 'nothing'), ('2018/10/20 07:13:00', 'nothing'), ('2018/10/20 15:40:00', 'nothing'), ('2018/10/20 18:33:00', 'nothing'), ('2019/01/10 09:39:00', 'nothing'), ('2019/01/28 04:28:00', 'nothing'), ('2019/01/28 04:28:30', 'nothing'), ('2018/10/31 07:14:30', 'nothing'), ('2018/11/10 01:47:00', 'nothing'), ('2018/11/11 04:34:00', 'nothing'), ('2018/11/24 07:32:00', 'nothing'), ('2018/11/28 03:33:30', 'nothing'), ('2018/12/01 04:31:00', 'nothing'), ('2018/12/01 17:57:30', 'nothing'), ('2018/12/02 00:06:00', 'nothing'), ('2018/12/16 05:55:00', 'nothing'), ('2019/01/14 07:12:30', 'nothing'), ('2018/10/24 03:21:30', 'nothing'), ('2018/10/24 05:31:00', 'nothing'), ('2018/10/24 05:31:30', 'nothing'), ('2018/11/10 04:55:30', 'nothing'), ('2019/01/29 23:04:00', 'nothing'), ('2019/01/29 23:04:30', 'nothing'), ('2018/10/08 00:07:30', 'nothing'), ('2018/10/08 00:55:30', 'nothing'), ('2018/10/08 19:09:30', 'nothing'), ('2018/10/09 10:21:30', 'nothing'), ('2018/10/09 10:52:30', 'nothing'), ('2018/10/09 11:10:00', 'nothing'), ('2018/10/09 14:13:00', 'nothing'), ('2018/10/11 13:48:30', 'nothing'), ('2018/10/11 19:07:30', 'nothing'), ('2018/10/13 01:58:00', 'nothing'), ('2019/01/17 20:58:00', 'nothing'), ('2019/01/17 20:58:30', 'nothing'), ('2019/01/17 20:59:00', 'nothing'), ('2018/10/21 05:25:00', 'nothing'), ('2018/11/29 12:29:00', 'nothing'), ('2018/12/17 08:03:00', 'nothing'), ('2018/12/18 12:57:30', 'nothing'), ('2018/12/21 12:41:00', 'nothing'), ('2018/12/21 23:33:30', 'nothing'), ('2018/12/23 16:38:30', 'nothing'), ('2018/10/09 15:32:30', 'nothing'), ('2018/10/07 16:35:30', 'nothing'), ('2018/10/07 20:57:30', 'nothing'), ('2018/10/13 07:34:30', 'nothing'), ('2018/10/11 19:06:30', 'nothing'), ('2018/10/16 00:29:30', 'nothing'), ('2018/10/16 21:31:00', 'nothing'), ('2018/10/16 23:55:00', 'nothing'), ('2018/10/31 17:06:30', 'nothing'), ('2018/10/31 23:10:00', 'nothing'), ('2018/10/07 16:36:00', 'nothing'), ('2018/10/10 20:02:00', 'nothing'), ('2018/10/15 00:16:30', 'nothing'), ('2018/10/15 18:52:30', 'nothing'), ('2018/10/23 19:03:00', 'nothing'), ('2018/11/03 13:20:30', 'nothing'), ('2018/11/03 21:06:30', 'nothing'), ('2018/11/06 09:39:00', 'nothing'), ('2018/11/05 22:05:30', 'nothing'), ('2018/12/01 04:32:30', 'nothing'), ('2018/10/09 17:26:30', 'nothing'), ('2018/10/09 11:21:00', 'nothing'), ('2018/10/11 14:30:00', 'nothing'), ('2018/10/15 09:02:00', 'nothing'), ('2018/10/20 19:11:00', 'nothing'), ('2018/10/29 19:56:00', 'nothing'), ('2018/11/02 15:23:00', 'nothing'), ('2018/11/06 21:46:00', 'nothing'), ('2018/11/10 06:11:30', 'nothing'), ('2018/11/22 18:12:00', 'nothing'), ('2018/10/07 20:56:30', 'nothing'), ('2018/10/09 23:02:00', 'nothing'), ('2018/10/13 12:38:30', 'nothing'), ('2018/10/17 21:47:30', 'nothing'), ('2018/10/21 19:29:30', 'nothing'), ('2018/11/04 08:34:00', 'nothing'), ('2018/11/18 23:55:00', 'nothing'), ('2018/11/28 07:30:00', 'nothing'), ('2018/12/24 05:55:00', 'nothing'), ('2019/01/02 02:07:00', 'nothing'), ('2018/10/11 10:49:30', 'nothing'), ('2018/10/28 11:49:00', 'nothing'), ('2018/10/31 07:30:30', 'nothing'), ('2018/11/04 08:22:30', 'nothing'), ('2018/11/10 01:23:00', 'nothing'), ('2018/11/13 20:14:00', 'nothing'), ('2018/11/18 20:23:00', 'nothing'), ('2018/11/20 19:59:30', 'nothing'), ('2018/12/02 04:30:30', 'nothing'), ('2019/01/08 00:10:30', 'nothing'), ('2018/10/11 12:44:30', 'nothing'), ('2018/10/17 16:59:30', 'nothing'), ('2018/10/29 23:47:30', 'nothing'), ('2018/11/06 23:35:00', 'nothing'), ('2018/11/11 00:07:00', 'nothing'), ('2018/11/24 16:58:00', 'nothing'), ('2018/12/08 11:25:00', 'nothing'), ('2019/01/10 11:03:30', 'nothing'), ('2019/01/26 00:02:30', 'nothing'), ('2019/01/27 12:50:30', 'nothing'), ('2018/10/09 10:52:00', 'nothing'), ('2018/10/17 19:22:00', 'nothing'), ('2018/11/07 16:49:30', 'nothing'), ('2018/11/10 00:58:00', 'nothing'), ('2018/11/10 04:09:30', 'nothing'), ('2018/11/13 14:54:00', 'nothing'), ('2018/12/05 17:57:00', 'nothing'), ('2019/01/09 16:01:00', 'nothing'), ('2019/01/29 23:15:30', 'nothing'), ('2018/10/28 13:32:30', 'nothing'), ('2018/10/09 16:49:30', 'nothing'), ('2018/10/13 14:14:30', 'nothing'), ('2018/10/16 14:55:00', 'nothing'), ('2018/10/24 06:09:30', 'nothing'), ('2018/10/29 23:49:30', 'nothing'), ('2018/11/03 01:26:00', 'nothing'), ('2018/11/20 20:03:30', 'nothing'), ('2018/11/29 17:40:00', 'nothing'), ('2018/12/12 08:36:30', 'nothing'), ('2019/01/28 04:38:00', 'nothing'), ('2018/10/09 17:26:00', 'nothing'), ('2018/10/15 11:49:30', 'nothing'), ('2018/10/28 08:10:30', 'nothing'), ('2018/11/07 04:38:00', 'nothing'), ('2018/11/10 00:47:30', 'nothing'), ('2018/11/10 04:09:00', 'nothing'), ('2018/11/13 11:19:30', 'nothing'), ('2018/11/24 00:40:30', 'nothing'), ('2018/12/06 13:17:30', 'nothing'), ('2019/01/26 00:01:30', 'nothing'), ('2018/10/07 13:54:30', 'nothing'), ('2018/10/11 14:55:30', 'nothing'), ('2018/10/15 18:35:00', 'nothing'), ('2018/10/18 20:11:00', 'nothing'), ('2018/10/22 11:48:30', 'nothing'), ('2018/11/07 09:52:00', 'nothing'), ('2018/11/13 17:03:30', 'nothing'), ('2018/12/03 22:20:30', 'nothing'), ('2018/12/22 19:01:30', 'nothing'), ('2019/01/17 18:17:30', 'nothing'), ('2018/10/07 18:34:30', 'nothing'), ('2018/10/18 01:44:00', 'nothing'), ('2018/10/23 01:04:00', 'nothing'), ('2018/10/26 10:46:00', 'nothing'), ('2018/10/27 01:15:30', 'nothing'), ('2018/10/28 07:24:00', 'nothing'), ('2018/11/01 19:34:30', 'nothing'), ('2018/11/10 02:14:00', 'nothing'), ('2018/11/13 15:01:30', 'nothing'), ('2018/11/23 11:51:30', 'nothing'), ('2018/10/07 12:00:00', 'nothing'), ('2018/10/11 17:26:00', 'nothing'), ('2018/10/21 10:01:30', 'nothing'), ('2018/10/31 22:51:30', 'nothing'), ('2018/11/20 20:01:00', 'nothing'), ('2018/12/07 10:28:30', 'nothing'), ('2019/01/11 15:20:00', 'nothing'), ('2019/01/29 22:49:30', 'nothing'), ('2019/01/29 06:41:30', 'nothing'), ('2018/11/13 20:14:30', 'nothing'), ('2018/10/09 13:30:30', 'nothing'), ('2018/10/15 08:57:00', 'nothing'), ('2018/10/21 03:22:00', 'nothing'), ('2018/10/30 18:22:00', 'nothing'), ('2018/11/13 20:03:30', 'nothing'), ('2018/12/06 17:45:30', 'nothing'), ('2018/12/25 02:11:30', 'nothing'), ('2019/01/31 19:22:00', 'nothing'), ('2019/01/22 17:08:30', 'nothing'), ('2018/11/20 20:29:00', 'nothing'), ('2018/10/09 10:20:30', 'nothing'), ('2018/10/17 23:51:30', 'nothing'), ('2018/10/27 13:23:30', 'nothing'), ('2018/11/03 19:53:00', 'nothing'), ('2018/11/07 16:32:00', 'nothing'), ('2018/11/11 11:37:30', 'nothing'), ('2018/11/24 18:27:30', 'nothing'), ('2018/12/01 21:11:00', 'nothing'), ('2018/12/09 02:11:30', 'nothing'), ('2019/01/30 05:33:30', 'nothing'), ('2018/10/09 10:21:00', 'nothing'), ('2018/10/17 16:31:00', 'nothing'), ('2018/10/28 15:38:30', 'nothing'), ('2018/11/09 22:46:00', 'nothing'), ('2018/11/10 01:56:00', 'nothing'), ('2018/11/10 04:57:00', 'nothing'), ('2018/11/18 13:47:00', 'nothing'), ('2019/01/15 15:10:00', 'nothing'), ('2019/01/18 10:14:30', 'nothing'), ('2019/01/30 13:27:00', 'nothing'), ('2018/10/14 22:56:00', 'nothing'), ('2018/10/15 13:22:00', 'nothing'), ('2018/10/16 07:16:00', 'nothing'), ('2018/10/16 21:34:00', 'nothing'), ('2018/10/18 07:11:30', 'nothing'), ('2018/10/29 12:45:00', 'nothing'), ('2019/01/30 05:34:00', 'nothing'), ('2019/01/10 08:49:00', 'nothing'), ('2018/11/10 05:25:00', 'nothing'), ('2018/11/10 04:02:30', 'nothing'), ('2018/10/09 17:25:30', 'nothing'), ('2018/10/17 14:33:30', 'nothing'), ('2018/10/18 17:40:00', 'nothing'), ('2018/11/03 17:26:30', 'nothing'), ('2018/11/10 00:47:00', 'nothing'), ('2018/11/10 03:06:00', 'nothing'), ('2018/11/20 10:36:00', 'nothing'), ('2018/11/26 11:51:30', 'nothing'), ('2018/12/24 20:36:30', 'nothing'), ('2019/01/15 00:03:00', 'nothing'), ('2018/10/11 14:29:00', 'nothing'), ('2018/11/02 18:33:30', 'nothing'), ('2018/10/09 18:57:30', 'nothing'), ('2018/11/09 22:23:00', 'nothing'), ('2018/11/09 23:26:00', 'nothing'), ('2018/11/10 00:30:00', 'nothing'), ('2018/12/29 02:13:00', 'nothing'), ('2019/01/08 14:41:30', 'nothing'), ('2019/01/09 16:45:00', 'nothing'), ('2019/01/26 15:17:00', 'nothing'), ('2018/10/14 00:39:00', 'nothing'), ('2018/10/16 07:14:30', 'nothing'), ('2018/10/31 22:41:00', 'nothing'), ('2018/11/10 01:27:00', 'nothing'), ('2018/11/11 22:47:00', 'nothing'), ('2018/12/01 20:48:00', 'nothing'), ('2018/12/15 22:13:30', 'nothing'), ('2018/12/19 10:45:30', 'nothing'), ('2018/12/23 18:05:00', 'nothing'), ('2019/01/24 17:35:30', 'nothing'), ('2018/11/09 23:28:00', 'nothing'), ('2018/11/30 23:05:00', 'nothing'), ('2018/12/07 23:17:30', 'nothing'), ('2018/10/11 14:28:00', 'nothing'), ('2018/10/17 19:18:30', 'nothing'), ('2018/10/27 16:49:00', 'nothing'), ('2018/11/03 16:49:30', 'nothing'), ('2018/11/04 10:04:30', 'nothing'), ('2018/11/04 19:37:00', 'nothing'), ('2018/11/07 07:23:00', 'nothing'), ('2018/11/12 11:58:00', 'nothing'), ('2018/12/08 11:11:00', 'nothing'), ('2018/12/26 01:29:00', 'nothing'), ('2018/10/15 01:23:30', 'nothing'), ('2018/11/09 22:50:00', 'nothing'), ('2018/11/09 23:51:30', 'nothing'), ('2019/01/17 20:57:30', 'nothing'), ('2018/10/17 11:32:00', 'nothing'), ('2018/10/28 08:17:00', 'nothing'), ('2018/10/29 12:45:30', 'nothing'), ('2018/10/29 12:45:30', 'nothing'), ('2018/11/03 01:27:00', 'nothing'), ('2018/11/09 23:01:30', 'nothing'), ('2018/11/10 01:23:30', 'nothing'), ('2018/11/10 02:03:00', 'nothing'), ('2018/11/22 17:51:30', 'nothing'), ('2018/11/23 11:56:00', 'nothing'), ('2018/11/10 02:51:00', 'nothing'), ('2018/11/10 00:18:30', 'nothing'), ('2018/10/09 10:10:00', 'nothing'), ('2018/11/01 07:08:00', 'nothing'), ('2018/11/10 02:51:30', 'nothing'), ('2019/01/23 13:42:00', 'nothing'), ('2018/11/10 02:29:00', 'nothing'), ('2018/11/10 04:31:30', 'nothing'), ('2019/01/09 15:46:30', 'nothing'), ('2018/11/09 23:27:30', 'nothing')]
NO_EVENTS_RECORDS_T_H = [('2018/11/27 08:10:30', 'nothing'), ('2018/11/29 02:08:00', 'nothing'), ('2018/11/30 23:02:00', 'nothing'), ('2018/12/01 12:52:00', 'nothing'), ('2018/12/01 16:00:30', 'nothing'), ('2018/12/02 01:15:30', 'nothing'), ('2018/12/03 10:08:30', 'nothing'), ('2018/12/03 15:08:30', 'nothing'), ('2018/12/06 18:26:00', 'nothing'), ('2018/12/06 23:31:30', 'nothing'), ('2018/12/01 15:48:00', 'nothing'), ('2018/12/02 10:28:00', 'nothing'), ('2018/12/03 10:08:00', 'nothing'), ('2018/12/03 23:00:30', 'nothing'), ('2018/12/04 12:16:30', 'nothing'), ('2018/12/05 08:19:00', 'nothing'), ('2018/12/07 11:55:30', 'nothing'), ('2018/12/07 22:44:00', 'nothing'), ('2018/12/19 12:26:00', 'nothing'), ('2018/12/19 17:28:30', 'nothing'), ('2018/12/03 18:51:00', 'nothing'), ('2018/12/16 07:55:30', 'nothing'), ('2018/12/22 08:17:00', 'nothing'), ('2018/12/24 07:27:00', 'nothing'), ('2018/12/24 08:11:00', 'nothing'), ('2018/12/26 12:45:30', 'nothing'), ('2018/12/27 12:49:30', 'nothing'), ('2018/12/27 15:39:30', 'nothing'), ('2018/12/28 11:54:00', 'nothing'), ('2018/12/28 15:40:00', 'nothing'), ('2018/12/26 18:32:00', 'nothing'), ('2018/12/27 20:19:30', 'nothing'), ('2018/12/28 06:19:30', 'nothing'), ('2018/12/30 07:27:00', 'nothing'), ('2018/12/30 10:06:00', 'nothing'), ('2018/12/31 06:38:00', 'nothing'), ('2018/12/31 11:53:30', 'nothing'), ('2019/01/01 17:04:00', 'nothing'), ('2019/01/08 06:42:00', 'nothing'), ('2019/01/08 21:53:30', 'nothing'), ('2018/12/27 23:48:00', 'nothing'), ('2018/12/28 09:42:30', 'nothing'), ('2018/12/28 22:01:00', 'nothing'), ('2018/12/31 06:27:30', 'nothing'), ('2018/12/31 11:53:30', 'nothing'), ('2019/01/02 10:04:30', 'nothing'), ('2019/01/03 06:18:30', 'nothing'), ('2019/01/04 21:53:00', 'nothing'), ('2019/01/07 06:21:30', 'nothing'), ('2019/01/08 10:18:30', 'nothing'), ('2018/12/26 06:18:30', 'nothing'), ('2019/01/08 21:59:00', 'nothing'), ('2019/01/13 09:07:30', 'nothing'), ('2019/01/19 22:32:00', 'nothing'), ('2019/02/01 18:21:30', 'nothing'), ('2019/02/11 16:58:00', 'nothing'), ('2019/02/15 20:06:30', 'nothing'), ('2019/02/19 18:06:30', 'nothing'), ('2019/02/27 18:58:30', 'nothing'), ('2019/03/02 19:42:30', 'nothing'), ('2019/03/03 15:01:30', 'nothing'), ('2019/03/08 12:21:00', 'nothing'), ('2019/03/09 07:55:30', 'nothing'), ('2019/03/10 19:12:00', 'nothing'), ('2019/03/10 19:48:00', 'nothing'), ('2019/03/14 06:23:30', 'nothing'), ('2019/03/14 07:28:00', 'nothing'), ('2019/03/15 12:50:30', 'nothing'), ('2019/03/20 10:40:00', 'nothing'), ('2019/03/21 08:02:30', 'nothing'), ('2019/02/27 18:58:30', 'nothing'), ('2019/03/09 07:55:30', 'nothing'), ('2019/03/14 07:28:00', 'nothing'), ('2019/03/24 10:23:00', 'nothing'), ('2018/11/26 22:27:00', 'nothing'), ('2018/12/06 20:56:00', 'nothing'), ('2018/12/16 07:55:30', 'nothing'), ('2018/12/26 06:18:30', 'nothing'), ('2018/12/26 18:31:30', 'nothing'), ('2019/01/15 06:58:00', 'nothing'), ('2019/01/05 16:09:00', 'nothing'), ('2019/01/05 16:57:30', 'nothing'), ('2019/01/08 21:58:30', 'nothing'), ('2019/01/19 12:14:00', 'nothing'), ('2019/01/19 21:12:00', 'nothing'), ('2019/02/08 06:31:30', 'nothing'), ('2019/03/05 06:23:30', 'nothing'), ('2019/03/09 07:55:30', 'nothing'), ('2019/03/15 08:08:30', 'nothing'), ('2019/03/20 10:40:00', 'nothing'), ('2019/01/16 07:48:00', 'nothing'), ('2019/01/19 12:14:00', 'nothing'), ('2019/01/21 21:45:00', 'nothing'), ('2019/02/11 11:13:30', 'nothing'), ('2019/01/30 19:27:30', 'nothing'), ('2019/01/30 19:28:00', 'nothing'), ('2019/02/20 18:47:30', 'nothing'), ('2019/02/20 18:48:00', 'nothing'), ('2019/02/24 11:03:30', 'nothing'), ('2019/02/24 11:05:00', 'nothing'), ('2018/12/03 07:14:00', 'nothing'), ('2018/12/03 07:14:30', 'nothing'), ('2018/12/26 18:32:30', 'nothing'), ('2019/01/05 16:58:00', 'nothing'), ('2019/01/21 21:46:00', 'nothing'), ('2019/01/21 21:50:00', 'nothing'), ('2019/01/30 19:28:00', 'nothing'), ('2019/02/20 18:47:30', 'nothing'), ('2019/02/20 18:48:00', 'nothing'), ('2019/02/27 18:58:30', 'nothing'), ('2018/12/03 07:14:00', 'nothing'), ('2018/12/03 07:14:30', 'nothing'), ('2018/12/20 10:42:00', 'nothing'), ('2018/12/20 10:42:30', 'nothing'), ('2019/01/27 11:15:30', 'nothing'), ('2019/01/27 11:16:00', 'nothing'), ('2019/01/30 19:28:00', 'nothing'), ('2019/02/11 11:11:30', 'nothing'), ('2019/02/20 18:47:30', 'nothing'), ('2019/02/20 18:48:00', 'nothing'), ('2018/12/03 07:14:00', 'nothing'), ('2018/12/03 07:14:30', 'nothing'), ('2019/01/16 11:29:00', 'nothing'), ('2019/01/16 11:29:30', 'nothing'), ('2019/01/30 19:28:00', 'nothing'), ('2019/02/11 09:39:00', 'nothing'), ('2019/02/11 09:40:30', 'nothing'), ('2019/02/11 16:52:00', 'nothing'), ('2019/02/13 22:14:00', 'nothing'), ('2019/02/13 22:14:30', 'nothing'), ('2018/12/07 15:35:00', 'nothing'), ('2018/12/20 10:42:00', 'nothing'), ('2018/12/20 10:42:30', 'nothing'), ('2019/01/15 09:15:00', 'nothing'), ('2019/02/04 18:51:00', 'nothing'), ('2019/02/04 18:51:30', 'nothing'), ('2019/02/11 09:39:00', 'nothing'), ('2019/02/20 18:48:00', 'nothing'), ('2019/02/24 11:05:00', 'nothing'), ('2019/02/27 18:58:30', 'nothing'), ('2018/12/20 10:42:00', 'nothing'), ('2018/12/20 10:42:30', 'nothing'), ('2019/02/04 18:51:00', 'nothing'), ('2019/02/04 18:51:30', 'nothing'), ('2019/02/20 18:48:00', 'nothing'), ('2019/02/24 11:05:00', 'nothing'), ('2019/03/14 18:09:30', 'nothing'), ('2019/03/16 12:21:30', 'nothing'), ('2019/03/16 12:22:00', 'nothing'), ('2019/03/25 09:15:30', 'nothing'), ('2018/12/20 10:42:00', 'nothing'), ('2018/12/20 10:42:30', 'nothing'), ('2019/01/16 11:28:00', 'nothing'), ('2019/01/16 11:30:00', 'nothing'), ('2019/01/21 21:52:00', 'nothing'), ('2019/02/04 18:51:00', 'nothing'), ('2019/02/20 18:48:00', 'nothing'), ('2019/01/28 22:03:30', 'nothing'), ('2019/01/28 22:04:00', 'nothing'), ('2019/01/28 22:04:30', 'nothing'), ('2018/12/20 07:03:00', 'nothing'), ('2018/12/20 10:42:00', 'nothing'), ('2019/01/15 09:16:00', 'nothing'), ('2019/01/16 11:28:30', 'nothing'), ('2019/01/21 21:45:00', 'nothing'), ('2019/01/21 21:50:30', 'nothing'), ('2019/01/25 06:50:30', 'nothing'), ('2019/01/27 11:15:30', 'nothing'), ('2019/02/03 08:20:30', 'nothing'), ('2019/02/11 09:39:30', 'nothing'), ('2018/12/20 10:42:00', 'nothing'), ('2019/01/30 06:17:30', 'nothing'), ('2019/02/07 20:46:00', 'nothing'), ('2019/02/07 20:47:30', 'nothing'), ('2019/02/13 22:09:00', 'nothing'), ('2019/02/13 22:12:30', 'nothing'), ('2019/02/14 07:15:30', 'nothing'), ('2019/02/14 07:16:00', 'nothing'), ('2019/02/20 18:48:00', 'nothing'), ('2019/03/16 12:22:00', 'nothing'), ('2019/01/16 11:30:30', 'nothing'), ('2019/02/14 07:15:30', 'nothing'), ('2019/02/14 07:16:00', 'nothing'), ('2019/03/09 16:24:30', 'nothing'), ('2019/03/25 19:22:30', 'nothing'), ('2019/03/25 19:23:00', 'nothing'), ('2019/01/13 18:50:00', 'nothing'), ('2019/01/13 18:50:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/01/13 18:51:30', 'nothing'), ('2019/01/13 18:50:00', 'nothing'), ('2019/01/13 18:50:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/01/13 18:51:30', 'nothing'), ('2019/01/16 11:28:00', 'nothing'), ('2019/01/16 11:37:00', 'nothing'), ('2019/01/23 07:11:00', 'nothing'), ('2019/01/23 07:11:30', 'nothing'), ('2019/01/23 07:12:00', 'nothing'), ('2019/03/16 15:26:00', 'nothing'), ('2019/01/13 18:50:00', 'nothing'), ('2019/01/13 18:50:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/01/15 09:15:00', 'nothing'), ('2019/01/26 12:10:00', 'nothing'), ('2019/01/26 12:10:30', 'nothing'), ('2019/02/04 09:42:00', 'nothing'), ('2019/02/04 09:42:30', 'nothing'), ('2019/02/04 09:43:00', 'nothing'), ('2019/02/14 07:15:30', 'nothing'), ('2019/01/13 18:50:00', 'nothing'), ('2019/01/13 18:50:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/01/26 12:10:00', 'nothing'), ('2019/02/04 09:42:30', 'nothing'), ('2019/02/04 09:43:00', 'nothing'), ('2019/02/10 10:34:00', 'nothing'), ('2019/02/10 10:34:30', 'nothing'), ('2019/02/13 22:14:30', 'nothing'), ('2019/02/20 18:48:00', 'nothing'), ('2019/01/13 18:50:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/02/04 09:43:00', 'nothing'), ('2019/02/10 10:34:00', 'nothing'), ('2019/02/10 10:34:30', 'nothing'), ('2019/02/21 18:02:00', 'nothing'), ('2019/02/21 18:02:30', 'nothing'), ('2019/02/21 18:03:00', 'nothing'), ('2019/03/25 19:22:30', 'nothing'), ('2019/03/25 19:23:00', 'nothing'), ('2018/12/22 08:17:30', 'nothing'), ('2019/01/13 18:50:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/02/04 09:43:00', 'nothing'), ('2019/02/10 10:34:00', 'nothing'), ('2019/02/21 18:02:00', 'nothing'), ('2019/02/21 18:02:30', 'nothing'), ('2019/03/09 16:24:00', 'nothing'), ('2019/03/25 19:22:30', 'nothing'), ('2019/03/25 19:23:00', 'nothing'), ('2019/01/13 18:50:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/01/20 21:25:00', 'nothing'), ('2019/01/20 21:25:30', 'nothing'), ('2019/01/20 21:26:00', 'nothing'), ('2019/01/20 21:26:30', 'nothing'), ('2019/02/10 10:34:00', 'nothing'), ('2019/02/13 22:10:00', 'nothing'), ('2019/02/21 18:02:00', 'nothing'), ('2019/02/21 18:02:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/01/20 21:25:00', 'nothing'), ('2019/01/20 21:25:30', 'nothing'), ('2019/01/20 21:26:00', 'nothing'), ('2019/01/20 21:26:30', 'nothing'), ('2019/01/26 12:09:30', 'nothing'), ('2019/01/26 12:10:30', 'nothing'), ('2019/01/26 12:11:30', 'nothing'), ('2019/01/30 06:17:30', 'nothing'), ('2019/02/10 10:34:00', 'nothing'), ('2018/12/07 15:35:00', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/01/20 21:25:00', 'nothing'), ('2019/01/20 21:25:30', 'nothing'), ('2019/01/20 21:26:00', 'nothing'), ('2019/02/13 22:09:00', 'nothing'), ('2019/02/13 22:10:00', 'nothing'), ('2019/02/21 18:02:30', 'nothing'), ('2019/02/25 20:41:30', 'nothing'), ('2019/03/02 12:56:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/01/16 11:37:00', 'nothing'), ('2019/01/21 21:45:30', 'nothing'), ('2019/02/21 18:02:30', 'nothing'), ('2019/02/26 12:59:30', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/02/26 13:01:00', 'nothing'), ('2019/03/02 12:56:30', 'nothing'), ('2019/03/08 17:27:30', 'nothing'), ('2019/01/13 18:51:00', 'nothing'), ('2019/01/20 21:25:00', 'nothing'), ('2019/01/20 21:26:00', 'nothing'), ('2019/02/21 18:02:30', 'nothing'), ('2019/02/26 12:59:30', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/02/26 13:01:00', 'nothing'), ('2019/02/27 16:04:30', 'nothing'), ('2019/03/02 12:56:30', 'nothing'), ('2018/12/24 15:22:30', 'nothing'), ('2019/01/19 21:13:00', 'nothing'), ('2019/01/20 21:26:00', 'nothing'), ('2019/02/21 18:02:30', 'nothing'), ('2019/02/26 12:59:30', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/03/02 12:16:00', 'nothing'), ('2019/03/02 12:17:00', 'nothing'), ('2019/03/02 12:56:30', 'nothing'), ('2019/01/28 22:02:00', 'nothing'), ('2019/02/26 12:59:30', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/03/02 12:16:00', 'nothing'), ('2019/03/02 12:17:00', 'nothing'), ('2019/03/02 12:56:30', 'nothing'), ('2019/03/05 08:32:00', 'nothing'), ('2019/03/25 22:22:30', 'nothing'), ('2019/01/20 21:26:00', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/03/02 12:17:00', 'nothing'), ('2019/03/02 12:56:30', 'nothing'), ('2019/03/07 21:01:00', 'nothing'), ('2019/02/26 12:59:30', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/03/02 12:17:00', 'nothing'), ('2019/03/02 12:56:30', 'nothing'), ('2018/12/03 16:00:00', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/03/25 19:22:30', 'nothing'), ('2019/01/20 21:26:00', 'nothing'), ('2019/01/20 21:26:30', 'nothing'), ('2019/02/21 18:02:30', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/03/21 08:02:00', 'nothing'), ('2019/02/26 12:59:30', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/03/05 08:32:00', 'nothing'), ('2019/03/21 08:02:30', 'nothing'), ('2019/01/20 21:26:00', 'nothing'), ('2019/01/20 21:26:30', 'nothing'), ('2019/02/10 21:28:30', 'nothing'), ('2019/02/26 13:00:30', 'nothing'), ('2019/03/21 08:02:00', 'nothing'), ('2018/12/26 04:36:00', 'nothing'), ('2019/02/03 08:20:30', 'nothing'), ('2019/02/21 18:02:30', 'nothing'), ('2019/02/26 12:59:30', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2019/03/02 12:17:00', 'nothing'), ('2019/01/21 21:45:30', 'nothing'), ('2019/01/16 11:29:30', 'nothing'), ('2019/02/26 13:00:00', 'nothing'), ('2018/12/03 16:00:00', 'nothing')]
OPEN_CO2 = {'co2_in_ppm': 'co2_in'}
OPEN_T_H = {'rh_in2_absolute_g_m3': 'rh_in_absolute', 'rh_in2_specific_g_kg': 'rh_in_specific', 'temperature_in2_celsius': 'temperature_in'}
PREDICTOR_CO2 = {'co2_in_ppm_diff': 'co2_in_diff', 'rh_in_absolute_g_m3_diff': 'rh_in_absolute_diff', 'rh_in_specific_g_kg_diff': 'rh_in_specific_diff', 'temperature_in_celsius_diff': 'temperature_in_diff'}
PREDICTOR_T_H = {'rh_in2_absolute_g_m3_diff': 'rh_in_absolute_diff', 'rh_in2_specific_g_kg_diff': 'rh_in_specific_diff', 'temperature_in2_celsius_diff': 'temperature_diff'}
dm.models.open_detector.create_attrs.func_co2(timestamp, row_selector, interval_selector, columns_map, end=None)
It calculates attributes used for detector creation on the basis of CO2 concentration that

detects window opening.

Parameters
  • timestamp – timestamp when an event occurred

  • row_selector – selector of row

  • interval_selector – selector of interval

  • columns_map – mapping of column names

  • end – deprecated

Returns

attributes used for detector creation on the basis of CO2 concentration

dm.models.open_detector.create_attrs.func_predict_co2(timestamp, row_selector, interval_selector, columns_map, end=None)

It calculates attributes used for predictor creation on the basis of CO2 concentration.

Parameters
  • timestamp – timestamp when an event occurred

  • row_selector – selector of row

  • interval_selector – selector of interval

  • columns_map – mapping of column names

  • end – deprecated timestamp that denotes end of event

Returns

attributes used for predictor creation on the basis of CO2 concentration

dm.models.open_detector.create_attrs.func_predict_t_h(timestamp, row_selector, interval_selector, columns_map, end=None)

It calculates attributes used for predictor creation on the basis of temperature and humidity.

Parameters
  • timestamp – timestamp when an event occurred

  • row_selector – selector of row

  • interval_selector – selector of interval

  • columns_map – mapping of column names

  • end – timestamp that denotes end of event

Returns

attributes used for predictor creation on the basis of temperature and humidity

dm.models.open_detector.create_attrs.func_t_h(timestamp, row_selector, interval_selector, columns_map, end=None)
It calculates attributes used for detector creation on the basis of temperature and humidity that

detects window opening.

Parameters
  • timestamp – timestamp when an event occurred

  • row_selector – selector of row

  • interval_selector – selector of interval

  • columns_map – mapping of column names

  • end – deprecated

Returns

attributes used for detector creation on the basis of temperature and humidity

dm.models.open_detector.generic_training_file module

Creates adapted models for window opening detection.

dm.models.open_detector.generic_training_file.add_func(events, cls, devs, model_type, interval_extension, mapper, func, weather)

It adds events to training dataset.

The training dataset contains events when a window was closed.

Parameters
  • events – list of events

  • cls – list of clients

  • devs – list of devices

  • model_type – type of model - based on CO2 concentration or temperature and humidity

  • interval_extension – time shift that is subtracted or added to start or end of an interval respectively

  • mapper – dictionary containing mapping of attribute name in database to the name used in dataset

  • func – object that determines function used for attribute calculation

  • weather – object used to get information about weather

Returns

records containing information about given events

dm.models.open_detector.generic_training_file.generic_training_file(events_file, no_event_time_shift, model_type, columns_map, cls, devs, weather)

It creates generic training dataset.

The training dataset contains the same number of events when a window was open and when it was closed.

Parameters
  • events_file – file containing events

  • no_event_time_shift – number of seconds subtracted from start of event to define event when a window was closed

  • model_type – type of model - based on CO2 concentration or temperature and humidity

  • columns_map – mapping of column names

  • cls – list of clients

  • devs – list of devices

  • weather – object used to get information about weather

Returns

generic training dataset

dm.models.open_detector.generic_training_file.training_data(json_f, cls, devs, model_type, no_event_time_shift, interval_extension, mapper, func, weather)

It creates training dataset.

The training dataset contains events when a window was open.

Parameters
  • json_f – dictionary that contains information about events

  • cls – list of clients

  • devs – list of devices

  • model_type – type of model - based on CO2 concentration or temperature and humidity

  • no_event_time_shift – number of seconds subtracted from start of event to define event when a window was closed

  • interval_extension – time shift that is subtracted or added to start or end of an interval respectively

  • mapper – dictionary containing mapping of attribute name in database to the name used in dataset

  • func – object that determines function used for attribute calculation

  • weather – object used to get information about weather

Returns

training dataset

dm.models.open_detector.generic_training_file_from_local_db module

Detector for window opening based on CO2 decrease with iterations.

dm.models.open_detector.generic_training_file_from_local_db.generic_testing(directory, columns_map)

It creates several testing datasets.

Parameters
  • directory – name of directory

  • columns_map – mapping of column names

Returns

None

dm.models.open_detector.generic_training_file_from_local_db.testing_month(table_name, start, directory, columns_map)

It creates testing dataset month by month.

Parameters
  • table_name – name of table

  • start – timestamp that denotes start of time interval

  • end – timestamp that denotes end of time interval

  • directory – name of directory

  • columns_map – mapping of column names

Returns

None

dm.models.open_detector.generic_training_file_from_local_db.testing_set(table_name: str, start, end, filename, columns_map)

It creates testing dataset.

Parameters
  • table_name – name of table

  • start – timestamp that denotes start of time interval

  • end – timestamp that denotes end of time interval

  • filename – name of output file

  • columns_map – mapping of column names

Returns

None

dm.models.open_detector.generic_training_file_from_local_db.training_set_co2(events_file, no_event_time_shift, table_name, output_filename, columns_map)
It creates balanced training dataset for detector creation based on CO2 concentration

and CSV file containing the dataset.

Parameters
  • events_file – file containing events

  • no_event_time_shift – number of seconds subtracted from start of event to define event when a window was closed

  • table_name – name of table

  • output_filename – name of output file

  • columns_map – mapping of column names

Returns

balanced training dataset for detector creation based on CO2 concentration

dm.models.open_detector.generic_training_file_from_local_db.training_set_t_h(events_file, no_event_time_shift, table_name, output_filename, columns_map)
It creates balanced training dataset for detector creation based on temperature and humidity

and CSV file containing the dataset.

Parameters
  • events_file – file containing events

  • no_event_time_shift – number of seconds subtracted from start of event to define event when a window was closed

  • table_name – name of table

  • output_filename – name of output file

  • columns_map – mapping of column names

Returns

balanced training dataset for detector creation based on temperature and humidity

Module contents