## Smartwatch data
All smartwatch-related data (collected by the Cozie platform) are contained in the training and test data files, for which there are details below explaining each of the columns. The physiological and environmental data were collected at a higher frequency than micro-survey responses.  Therefore, these datasets are sparse, i.e., many values are empty as not every row contains a microsurvey response. In the following code snippets, we show a few examples of how to filter the data to reduce the sparsity:

#### Filter for Cozie data from one particular participant: 
```python
filter = (df['id_participant']=='xesh001')
df[filter].head()
```
#### Filter for micro-survey responses from one particular participant:
```python
filter = (df['id_participant']=='xesh001') & (df['ws_survey_count'].notna())
df[filter].head()
```
#### Filter for heart rate data from one particular participant:
```python
filter = (df['id_participant']=='xesh001') & (df['ts_heart_rate'].notna())
df[filter]['ts_heart_rate'].head()
```
### Micro-survey data
There are two larger categories of data provided by the Cozie app: micro-survey data and physiological/activity/environmental data.

Only rows with micro-survey responses have an integer value in `ws_survey_count`. Columns with responses to the micro-survey question have the prefix `q_`. Only rows with micro-survey responses have longitude and latitude information (`ws_latitude`,`ws_longitude`). `ws_timestamp_location` is the timestamp of when the location data was retrieved. Usually, the value in `ws_timestamp_location` and `index` are close together. There are instances where the location information is much older than the watch survey response, i.e., `ws_timestamp_location`<<`index`. In some instances, no location data was collected for the micro-survey. In these cases, the longitude and latitude are zero.

For privacy reasons, some of the longitude and latitude data was altered. In cases where the micro-survey response column `q_location` value is 'Indoor - Home', the coordinates (longitude, latitude) were converted to a [hexagonal coordinate system](https://h3geo.org/) with an edge length of approximately 200m. Then, the hexagonal coordinates were converted back into longitude and latitude, resulting in intentionally degraded accuracy. `ws_timestamp_start` is the timestamp of when the micro-survey was started. For micro-surveys, the timestamp in `index` is the time when the watch survey was submitted.

| Field name                      | Type      | Unit | Description |
|-------------------------|-----------|------|-------------|
| `id_participant`             | string    | -    | Unique identifier for each participant |
| `id_unique`                   | string    | -    | Unique identifier for row |
| `index`                          | timestamp | time |Timestamp (UTC) also serves as index |
| `q_activity_category_alone`     | string    | -    | Response to micro-survey question 'Category of activity? (alone)' |
| `q_activity_category_group`     | string    | -    | Response to micro-survey question 'Category of activity? (group)' |
| `q_alone_group`                 | string    | -    | Response to micro-survey question 'Alone or in a group?' 
| `q_earphones`                   | string    | -    | Response to micro-survey question 'Wearing earphones?' |
| `q_location`                    | string    | -    | Response to micro-survey question 'Where are you?' |
| `q_location_office`             | string    | -    | Response to micro-survey question 'What kind of office' |
| `q_location_transport`          | string    | -    | Response to micro-survey question 'What kind of transport?' |
| `q_noise_kind`                  | string    | -    | Response to micro-survey question 'What kind of noise?' |
| `q_noise_nearby`                | string    | -    | Response to micro-survey question 'Noise distractions nearby? (without earphones)' |
| `q_thermal_preference`          | string    | -    | Response tomicro-survey question 'Thermally, what do you prefer now?' |
| `ws_latitude`                   | float     | °     | Latitude  |
| `ws_longitude`                  | float     | °     | Longitude |
| `ws_survey_count`               | float     | -     | Increasing counter for each micro-survey response. Resets when Cozie app is (re-)installed. |
| `ws_timestamp_location`         | datetime  | time  | Timestamp of the location measurement |
| `ws_timestamp_start`            | datetime  | time  | Timestamp of when micro-survey was started |
| `dT`                            | float     | min   | Duration between the current and the previous micro-survey response in minutes |

### Physiological / Environmental / Activity data
Independent of the micro-survey data, the Cozie app also collects physiological (heart rate, blood oxygen saturation, resting heart rate), environmental (noise), and activity data (stand time, step count, walking distance). The sampling intervals for these columns differ between columns and may change within a column.

| Field name                      | Type      | Unit | Description |
|-------------------------|-----------|------|-------------|
| `id_participant`             | string    | -    | Unique identifier for each participant |
| `id_unique`                   | string    | -    | Unique identifier for row |
| `index`                          | timestamp | time |Timestamp (UTC) of when micro-survey was submitted, also serves as index |
| `ts_audio_exposure_environment` | float     | dB(A)| Noise level, provided by [Apple HealthKit](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/3081271-environmentalaudioexposure) |
| `ts_heart_rate`                 | float     | bpm  | Heart rate, provided by [Apple HealthKit](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/1615138-heartrate)|
| `ts_oxygen_saturation`          | float     | %    | Blood oxygen saturation provided by [Apple HealthKit](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/1615377-oxygensaturation) |
| `ts_resting_heart_rate`         | float     | bpm  | Resting heart rate, provided by [Apple HealthKit](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/2867756-restingheartrate) |
| `ts_stand_time`                 | float     | min  | Stand time, provided by [Apple HealthKit](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/3174858-applestandtime) |
| `ts_step_count`                 | float     | steps | Number of steps walked, provided by [Apple HealthKit](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/1615548-stepcount). The timestamp `time` indicates the time of the first step in the sample. |
| `ts_walking_distance`           | float     | m     | Distance walked, provided by [Apple HealthKit](https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier/1615230-distancewalkingrunning). The timestamp `time` indicates the time of the meter in the sample. |

## Spatial Indicators
Rows that contain micro-survey responses also contain the geographic longitude and latitude (`ws_longitude`, `ws_latitude`). These coordinates were used to calculate the spatial indicators using the [Urbanity Python package](https://urbanity.readthedocs.io/en/latest/index.html). The spatial indicators are grouped into **Building Morphology** and **Point of Interest**. Details about the spatial indicator columns can be found in the table below. For more information on the spatial indicators, please refer to [Table 1](https://www.nature.com/articles/s41597-023-02578-1/tables/1) of [Yap, W., Biljecki, F. A Global Feature-Rich Network Dataset of Cities and Dashboard for Comprehensive Urban Analyses. Sci Data 10, 667 (2023). ](https://www.nature.com/articles/s41597-023-02578-1)

| Field name                      | Type      | Unit | Description |
|-------------------------|----------|-----|-------------|
| **Building Morphology**         |           |       |                                       |
| `Footprint Proportion`          | float     | %     | Footprint proportion                       |
| `Footprint Mean`                | float     | m
2
| Mean area                          |
| `Footprint Stdev`               | float     | m
2
| Area standard deviation            |
| `Perimeter Total`               | float     | m     | Total perimeter                            |
| `Perimeter Mean`                | float     | m     | Mean perimeter                             |
| `Perimeter Stdev`               | float     | m     | Perimeter standard deviation               |
| `Complexity Mean`               | float     | m     | Complexity mean                            |
| `Complexity Stdev`              | float     | m     | Complexity standard deviation              |
| `Building Count`                | float     | count | No. of buildings                           |
| **Population**                  |           |       |                                            |
| `PopSum`                        | float     | count | Total Population                           | 
| `Men`                           | float     | count | Male population                            | 
| `Women`                         | float     | count | Female population                          | 
| `Elderly`                       | float     | count | Elderly (aged 60+ years) population        | 
| `Youth`                         | float     | count | Young (15-24 years) population             | 
| `Children`                      | float     | count | Child (<5 years) population                | 
| **Point of Interest**           |           |       |                                            |
| `Civic`                         | float     | count | Civic amenities                            |
| `Commercial`                    | float     | count | Commercial amenities                       |
| `Entertainment`                 | float     | count | Entertainment amenities                    |
| `Food`                          | float     | count | Food amenities                             |
| `Healthcare`                    | float     | count | Healthcare amenities                       |
| `Institutional`                 | float     | count | Institutional amenities                    |
| `Recreational`                  | float     | count | Recreational amenities                     |
| `Social`                        | float     | count | Social amenities                           |
| `Green View Mean`               | float     | -    | Green view index                            |
| `Green View Stdev`              | float     | -    | Green view index, standard deviation        |
| `Sky View Mean`                 | float     | -    | Sky view index                              |
| `Sky View Stdev`                | float     | -    | Sky view index, standard deviation          |
| `Building View Mean`            | float     | -    | Building view index                         |
| `Building View Stdev`           | float     | -    | Building view index, standard deviation     |
| `Road View Mean`                | float     | -    | Road view index                             |
| `Road View Stdev`               | float     | -    | Road view index, standard deviation         |
| `Visual Complexity Mean`        | float     | -    | Visual complexity index                     |
| `Visual Complexity Stdev`       | float     | -    | Visual complexity index, standard deviation |


## Weather data
The weather data was retrieved from the  [National Environment Agency (NEA) via data.gov.sg](https://beta.data.gov.sg/collections/1459/view). Data for each weather parameter is in a separate file. The column names indicate the weather station id. There is an additional file for the weather stations, with the name and coordinates of the weather station. The units and accuracy of the weather that is shown in the table below.

| Measurement                 | Unit | Accuracy    |
|-------------------------|------|------------|
| Air temperature             | °C     | ±0.1°C        |
| Relative humidity           | %      | ±1%            |
| Rain fall                          | mm   | 2% at 1 l/h (0.26 gal/h) |
| Wind speed                   | knots | 0-35 m/s: ±0.3 m/s or ±3 % whichever is greater
35 m/s ... 60 m/s: ±5 % | 
| Wind direction               | °        |   ±3°          |