Where: faircode/detect.py (MAX_CATEGORICAL_CARD = 20), faircode/profiler.py (MAX_DIMENSION_GROUPS = 50), faircode/cli.py, faircode/SPEC.md section 7.
Current gap: SPEC.md section 7's "Defaults (single place to tune)" table lists MAX_CATEGORICAL_CARD and MAX_DIMENSION_GROUPS alongside MIN_SHARE_THRESHOLD, IMBALANCE_FLAG, etc., but only five of those constants actually got CLI/web overrides: --min-share, --intersection-floor, --imbalance-flag, --missing-flag, --min-group-size. MAX_CATEGORICAL_CARD (the 2-20 distinct-value window for generic-categorical auto-detection) and MAX_DIMENSION_GROUPS (the 50-group identifier/date-column drop cutoff) are plain hardcoded module constants with no flag anywhere (grep -n "max.categorical\|max.dimension" faircode/cli.py returns nothing). A dataset with a legitimately-categorical column of 21-40 distinct values (e.g. a detailed occupation or diagnosis-code field) currently falls outside the auto-detect window and can only be rescued one column at a time via --map col=categorical, rather than the user simply raising the cardinality ceiling once for the whole run.
Repro:
$ grep -n "MAX_CATEGORICAL_CARD\|MAX_DIMENSION_GROUPS" faircode/detect.py faircode/profiler.py
faircode/detect.py:...: MAX_CATEGORICAL_CARD = 20
faircode/profiler.py:...: MAX_DIMENSION_GROUPS = 50
$ grep -n "max.categorical\|max.dimension" faircode/cli.py
(no output)
Suggested approach: add --max-categorical-card N and --max-dimension-groups N to profile/compare (and matching threshold inputs in profiler.html's "Advanced thresholds" panel), threaded through _resolve_opts/opts the same way the other five tunables are, with the current 20/50 as defaults.
Where:
faircode/detect.py(MAX_CATEGORICAL_CARD = 20),faircode/profiler.py(MAX_DIMENSION_GROUPS = 50),faircode/cli.py,faircode/SPEC.mdsection 7.Current gap: SPEC.md section 7's "Defaults (single place to tune)" table lists
MAX_CATEGORICAL_CARDandMAX_DIMENSION_GROUPSalongsideMIN_SHARE_THRESHOLD,IMBALANCE_FLAG, etc., but only five of those constants actually got CLI/web overrides:--min-share,--intersection-floor,--imbalance-flag,--missing-flag,--min-group-size.MAX_CATEGORICAL_CARD(the 2-20 distinct-value window for generic-categorical auto-detection) andMAX_DIMENSION_GROUPS(the 50-group identifier/date-column drop cutoff) are plain hardcoded module constants with no flag anywhere (grep -n "max.categorical\|max.dimension" faircode/cli.pyreturns nothing). A dataset with a legitimately-categorical column of 21-40 distinct values (e.g. a detailed occupation or diagnosis-code field) currently falls outside the auto-detect window and can only be rescued one column at a time via--map col=categorical, rather than the user simply raising the cardinality ceiling once for the whole run.Repro:
Suggested approach: add
--max-categorical-card Nand--max-dimension-groups Ntoprofile/compare(and matching threshold inputs in profiler.html's "Advanced thresholds" panel), threaded through_resolve_opts/optsthe same way the other five tunables are, with the current 20/50 as defaults.