Ordinal data assigns observations to categories with a meaningful order, while the spacing between categories may not be equal. Integer codes can therefore represent ordered categories without making them continuous measurements. section 9.2.1
Treat ordinal variables carefully during exploratory analysis: Pearson correlation may be unreliable, while grouped distributions can reveal useful differences and guide feature selection. section 9.2.1
For comparisons involving ordinal data, rank-based non-parametric tests provide alternatives to distribution-dependent parametric tests:
- Mann–Whitney U compares two independent samples. section 5.4
- Wilcoxon signed-rank compares two dependent samples. section 5.4
- Kruskal–Wallis compares two or more independent samples. section 5.4
- Friedman compares three or more dependent samples. section 5.4
Calendar features and rat sightings
Deriving month number and day of week from dates creates ordinal predictors. Boxplots show seasonal patterns in rat sightings; weekday grouping reveals fewer reports on weekends, supporting a weekday feature. section 9.2.1
rats_weather["dow"] = rats_weather["day"].dt.dayofweek #1 rats_weather["month_num"] = rats_weather["day"].dt.month #2 rats_weather.head() #3
Inspect the feature-engineering listing that extracts day-of-week and month-number variables from dates. section 9.2.1







