NCA rejects string labels: preserve class meaning through an encoding workaround
Check supported inputs and a reversible mapping before changing label representation.
NCA rejects string labels: preserve class meaning through an encoding workaround
If numeric labels allow training while string classes are rejected, encoding may look like a practical workaround. Training completion alone does not establish that the same classification problem was preserved. The original label, encoded representation, and restored label need their own semantic contract. [1, 2, 3]
Scope of the source report
A public scikit-learn report compares a development NCA Python file placed in a stable native environment and describes string y being rejected by numeric validation. It says the original stable path accepts string arrays, lists, and object inputs. This is not a complete main build execution and does not confirm release behavior beyond that comparison. [1]
What to inspect in the input
Compare string and integer-encoded labels for the same samples. If a workaround is needed, retain a bidirectional mapping that traces each original class through restoration. Check that each code has a single class meaning and inspect decoded results. A task requiring a numeric regression target is distinct from support for string classes. [1, 3]
A small acceptance example
In the illustrative mapping, call the code representing cat A; decoding must return cat. Restoring dog cannot pass merely because training completed. A is a name used to explain the mapping; actual integer values must be retained according to the chosen encoder's contract. [1, 3]
The boundary passed to Truthound
Truthound Core's ColumnPairValidator can compare prepared original_label and restored_label columns. The operator defines reversible encoding semantics and supported actual inputs. This component checks label restoration, not NCA projection quality, and does not repair compatibility between a development Python file and its native environment. [1, 2, 3]
Application conditions
Link original string labels, encodings, and restored values for the same samples, retaining an approved bidirectional mapping.
Alternatives
Keep a supported stable path or use an explicit label encoder and verify outputs preserve the same meaning.
Limitations
The report is not a complete main-build execution, and simple label reconciliation does not guarantee NCA projection quality.
Evidence
- Event checked
- Subject checked
- Modified
