Skip to content

Building Dataset Partition#

smart_control.dataset.partition.BuildingDatasetPartition #

BuildingDatasetPartition(dataset: BuildingDataset, partition_id: str)

A helper class for handling a specific dataset partition. A partition is a subset of the building's data over a specific time period.

The partition contains information about observations, actions, and rewards for each time step:

  • observation: information the agent receives from the environment
  • action: a decision the agent makes to interact with the environment
  • reward info: feedback from the environment indicating the agent's performance, contains information needed to compute the reward
  • reward: results from passing the raw reward info through the reward function

Parameters:

Name Type Description Default
dataset BuildingDataset

The building dataset.

required
partition_id str

The identifier of a partition in the specified dataset (e.g. "2022_a").

required
Example
ds = BuildingDataset(dataset_id='sb1', download=True)
partition = BuildingDatasetPartition(dataset=ds, partition_id='2022_a')

action_ids cached property #

action_ids: list[str]

A list of unique action identifiers.

Action identifiers are in the format of device_id@field_name. For example: '12945159110931775488@supply_air_temperature_setpoint'.

action_timestamps cached property #

action_timestamps: list[Timestamp]

A list of sequential timestamps representing the time of each action.

action_value_matrix cached property #

action_value_matrix: ndarray

Time-series action data.

actions_df cached property #

actions_df: DataFrame

A time-series dataframe of numeric action values, constructed from the following components:

Returns:

Type Description
DataFrame

A pandas.DataFrame. Here is an example of the structure:

timestamp 12945159110931775488@supply_air_temperature_setpoint ... 14409954889734029312@supply_air_temperature_setpoint
2022-01-01 00:00:00+00:00 288.703705 ... 291.481476
2022-01-01 00:05:00+00:00 288.703705 ... 291.481476
2022-01-01 00:10:00+00:00 288.703705 ... 291.481476
2022-01-01 00:15:00+00:00 288.703705 ... 291.481476
2022-01-01 00:20:00+00:00 288.703705 ... 291.481476

observation_ids cached property #

observation_ids: list[str]

A list of unique observation identifiers.

Observation identifiers are in the format of device_id@field_name. For example: '2640423556868160@zone_air_temperature_sensor'.

observation_timestamps cached property #

observation_timestamps: list[Timestamp]

A list of sequential timestamps representing the time of each observation.

observation_value_matrix cached property #

observation_value_matrix: ndarray

Time-series observation data.

observations_df cached property #

observations_df: DataFrame

A time-series dataframe of numeric observation values, constructed from the following components:

Returns:

Type Description
DataFrame

A pandas.DataFrame. Here is an example of the structure:

timestamp 202194278473007104@building_air_static_pressure_setpoint ... 2640423556868160@zone_air_temperature_sensor
2022-01-01 00:00:00+00:00 7.472401 ... 68.500000
2022-01-01 00:05:00+00:00 7.472401 ... 68.300003
2022-01-01 00:10:00+00:00 7.472401 ... 68.300003
2022-01-01 00:15:00+00:00 7.472401 ... 68.000000
2022-01-01 00:20:00+00:00 7.472401 ... 68.000000

reward_info_ids cached property #

reward_info_ids: list[str]

A list of unique reward info identifiers.

See: RewardInfo in "smart_control/proto/smart_control_reward.proto".

Reward info identifiers are in the format of device_id@field_name or zone_id@field_name. For example:

  • 'rooms/9028552126@heating_setpoint_temperature'
  • '14409954889734029312@air_conditioning_electrical_energy_rate'

reward_info_timestamps cached property #

reward_info_timestamps: list[Timestamp]

A list of sequential timestamps related to reward information.

reward_info_value_matrix cached property #

reward_info_value_matrix: ndarray

Time series reward information data.

reward_infos_df cached property #

reward_infos_df: DataFrame

A time-series dataframe of numeric reward info values, constructed from the following components:

Returns:

Type Description
DataFrame

A pandas.DataFrame. Here is an example of the structure:

timestamp rooms/9028552126@heating_setpoint_temperature ... 14409954889734029312@air_conditioning_electrical_energy_rate
2021-12-31 23:55:00+00:00 294.0 ... 0.0
2022-01-01 00:00:00+00:00 294.0 ... 0.0
2022-01-01 00:05:00+00:00 294.0 ... 0.0
2022-01-01 00:10:00+00:00 294.0 ... 0.0
2022-01-01 00:15:00+00:00 294.0 ... 0.0

reward_ids cached property #

reward_ids: list[str]

A list of unique reward identifiers.

See: RewardResponse in "smart_control/proto/smart_control_reward.proto".

Returns:

Type Description
list[str]

A list of the reward identifiers:

[ "agent_reward_value", "productivity_reward", "electricity_energy_cost", "natural_gas_energy_cost", "carbon_emitted", "carbon_cost", "productivity_weight", "energy_cost_weight", "carbon_emission_weight", "person_productivity", "total_occupancy", "reward_scale", "reward_shift", "productivity_regret", "normalized_productivity_regret", "normalized_energy_cost", "normalized_carbon_emission" ]

reward_timestamps cached property #

reward_timestamps: list[Timestamp]

A list of sequential timestamps representing the time of each reward.

reward_value_matrix cached property #

reward_value_matrix: ndarray

Time-series reward data.

rewards_df cached property #

rewards_df: DataFrame

A time-series dataframe of numeric reward values, constructed from the following components:

Returns:

Type Description
DataFrame

A pandas.DataFrame. Here is an example of the structure:

timestamp agent_reward_value ... normalized_carbon_emission
2021-12-31 23:55:00+00:00 -1.005403e-08 ... 1.797313e-08
2022-01-01 00:00:00+00:00 -1.002312e-08 ... 1.782538e-08
2022-01-01 00:05:00+00:00 -1.002312e-08 ... 1.782538e-08
2022-01-01 00:10:00+00:00 -1.002312e-08 ... 1.782538e-08
2022-01-01 00:15:00+00:00 -5.737567e-09 ... 1.020384e-08