# 011. Commuter and casual rider mix

**Question:** How does the registered-rider share differ by day type and selected hours?

## Result

The largest computed metric is 0.958 for 1 / hour 7; the smallest is 0.6544 for 0 / hour 17. Metric: registered_share (Registered share).

Workingday 1 excludes weekends and source holidays. A registered rental is not necessarily a commute.

![Commuter and casual rider mix](outputs/chart.png)

| workingday | hr | registered | casual | total | observed_hours | registered_share | group |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 0 | 7 | 8039 | 1988 | 10027 | 231 | 0.8017 | 0 / hour 7 |
| 0 | 8 | 19688 | 4718 | 24406 | 231 | 0.8067 | 0 / hour 8 |
| 0 | 9 | 29246 | 10399 | 39645 | 231 | 0.7377 | 0 / hour 9 |
| 0 | 12 | 55443 | 29163 | 84606 | 231 | 0.6553 | 0 / hour 12 |
| 0 | 17 | 48911 | 25829 | 74740 | 231 | 0.6544 | 0 / hour 17 |
| 0 | 18 | 45272 | 19371 | 64643 | 230 | 0.7003 | 0 / hour 18 |
| 1 | 7 | 138095 | 6049 | 144144 | 496 | 0.958 | 1 / hour 7 |
| 1 | 8 | 225552 | 11043 | 236595 | 496 | 0.9533 | 1 / hour 8 |
| 1 | 9 | 107734 | 12059 | 119793 | 496 | 0.8993 | 1 / hour 9 |
| 1 | 12 | 79253 | 20555 | 99808 | 497 | 0.7941 | 1 / hour 12 |
| 1 | 17 | 233729 | 28391 | 262120 | 499 | 0.8917 | 1 / hour 17 |
| 1 | 18 | 220004 | 25125 | 245129 | 498 | 0.8975 | 1 / hour 18 |

The chart shows 12 of 12 result rows; the table previews the first 12 in the analysis-defined order. [Download the full result table](outputs/results.csv). Numerical values are computed from the source; missing results stay unavailable.

## Method

Aggregate rider counts before calculating shares at six declared hours.

The study uses shared source preparation and reusable statistical routines. Its specific transformations are in [analysis.py](analysis.py), and common model/evaluation code is in [portfolio/methods.py](../../portfolio/methods.py). The [notebook](analysis.ipynb) executes the study and displays the saved results.

## Decision and limitations

Use rider mix to frame service-planning questions without inferring individual traveler intent.

Historical system rentals measure realized use, not unmet demand or station inventory. Missing hours are unknown. Weather associations do not establish causal effects. 

Related studies may share observations or holdouts. These are focused analytical studies, not independent replications or deployed business systems. Any model refinements informed by these results need new untouched evaluation data. No commercial impact is inferred from an association or backtest.

## Reproduce

From the repository root, after installing `requirements.txt`:

```powershell
python projects/011-commuter-and-casual-rider-mix/analysis.py
```

Source data are downloaded automatically if absent. Original archives are retained unchanged and checked by SHA-256. The cleaned cache normalizes column names; field-specific changes are visible in [data preparation](../../portfolio/data.py). Runtime evidence is in [receipt.json](outputs/receipt.json).

## Source

[Bike Sharing](https://archive.ics.uci.edu/dataset/275/bike+sharing+dataset), Fanaee-T (2013). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/bikes.json) and [prepared-data audit](../../data/provenance/bikes_prepared.json) record the downloaded files, field coverage and hashes.
