Skip to content

Reland "Add experimental infer_stypes(_low_cardinality: bool)" - #990

Merged
akihironitta merged 1 commit into
mainfrom
reland-low-cardinality
Sep 26, 2026
Merged

akihironitta merged 1 commit into
mainfrom
reland-low-cardinality

Conversation

@akihironitta

Copy link
Copy Markdown
Member

Relands #987, which #988 reverted together with the AlignCategories removal.

Restore `infer_stypes(_low_cardinality=...)` from #987 and enable it for
`SDMKumoTabularModel`. The category pinning from #987 is not relanded, as
`AlignCategories` is back in the recipe (#988).

Co-authored-by: Jingang Qu <jqu@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@akihironitta akihironitta changed the title Reland Add experimental infer_stypes(_low_cardinality: bool) Reland "Add experimental infer_stypes(_low_cardinality: bool)" Sep 26, 2026
@akihironitta
akihironitta marked this pull request as ready for review September 26, 2026 00:55
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/structured-data-models/.coderabbit.yaml

Review profile: QUIET

Plan: Enterprise

Run ID: 6756968d-53e6-4da7-9d20-a1d847fbee70

📥 Commits

Reviewing files that changed from the base of the PR and between 0cab2be and 725dbf8.

📒 Files selected for processing (3)
  • benchmark/tabular/model.py
  • sdm/stype.py
  • test/test_stype.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features
    • Kumo Tabular models now identify numeric columns with two or three distinct values as categorical when the table contains at least 151 rows. This applies to integer and floating-point columns, as well as supported decimal columns.
  • Bug Fixes
    • Standard SDM inference continues to classify numeric columns as numerical by default, preserving existing behavior.

Walkthrough

infer_stypes can optionally classify numeric columns with two or three distinct values as categorical when they have at least 151 rows. SDMModel defaults this option off, while SDMKumoTabularModel enables it. Tests cover pandas, Arrow, and cuDF.

Changes

Low-cardinality numeric inference

Layer / File(s) Summary
Inference policy and backend classification
sdm/stype.py, test/test_stype.py
infer_stypes passes the policy to the Arrow, pandas, and cuDF helpers. When enabled, numeric columns qualify as categorical if they have at least 151 rows and two or three distinct values. Tests cover the row threshold and cardinalities.
Model inference settings
benchmark/tabular/model.py
SDMModel defaults the setting to off and passes it during fitting. SDMKumoTabularModel sets it to infer.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 725db

No confirmed issue blocks merging. Run the normal backend tests before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: relanding experimental low-cardinality inference in infer_stypes.
Description check ✅ Passed The description accurately explains the reland, adapter-specific enablement, and category preprocessing behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@akihironitta
akihironitta merged commit f8cdb27 into main Sep 26, 2026
4 checks passed
@akihironitta
akihironitta deleted the reland-low-cardinality branch September 26, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant