Description
Return its zero-based index and one at that position with zeros elsewhere.
Weights express relative contributions. Dividing by their total creates weights that sum to one when the total is positive, but it does not establish that the original weighting scheme is suitable for the decision.
Return its zero-based index and one at that position with zeros elsewhere.
When to use this tool
Use Onehot Single Category Index when you need to normalize or inspect a supplied collection of nonnegative weights.
How to use the tool and how it works
- Enter categories, category. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read index, oneHot. Use the output convention below.
Require unique category strings and category present in the list. Return its zero-based index and one at that position with zeros elsewhere.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| categories | Categories | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| category | Category | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| index | Position under the zero-based or one-based convention stated above. | Required. Safe integer. |
| oneHot | One Hot | Required. Array of safe integer; maximum items 256. |
{
"input": {
"categories": [
"red",
"green",
"blue"
],
"category": "green"
},
"output": {
"index": 1,
"oneHot": [
0,
1,
0
]
}
} Limitations and assumptions
- Unknown categories are rejected rather than given an all-zero encoding; category spelling and order are exact and supplied.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Document how the weights were chosen and test the sensitivity of the complete weighted result.
References
Similar or alternative tools
- Set Membership Four Way Label
Map the two Boolean membership flags to intersection, first-only, second-only, or neither.
- Assessment Item Objective Lookup
Return its paired objectiveCode.