Skip to content

Add categorical value decoding - #1262

Merged
rusty1s merged 2 commits into
mainfrom
categorical-decode
Oct 23, 2026
Merged

rusty1s merged 2 commits into
mainfrom
categorical-decode

Conversation

@rusty1s

@rusty1s rusty1s commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add CategoricalTensor.decode() to map category codes back to values while preserving the tensor's shape.

Description of the change

A single categorical column returns its decoded tensor; multiple columns return a ColumnarTensor so each column retains its dtype. Missing codes become nullable boolean/integer values, floating-point NaNs, or masked variable-length values. Noncontiguous batched inputs are supported.

Decoding requires at least one column. All-missing columns with an empty category vocabulary remain unsupported.

Validation

n/a

@copy-pr-bot

copy-pr-bot Bot commented Oct 23, 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.

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.92%. Comparing base (e6f62d5) to head (0e539c1).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sdm/tensor/categorical.py 86.36% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1262   +/-   ##
=======================================
  Coverage   82.91%   82.92%           
=======================================
  Files         173      173           
  Lines       11194    11215   +21     
=======================================
+ Hits         9282     9300   +18     
- Misses       1912     1915    +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@rusty1s
rusty1s marked this pull request as ready for review October 23, 2026 09:41
@rusty1s
rusty1s merged commit 27aa91c into main Oct 23, 2026
6 of 7 checks passed
@rusty1s
rusty1s deleted the categorical-decode branch October 23, 2026 09:44
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