Skip to content

Conversation

@Pasta-coder
Copy link
Contributor

This pull request introduces a new dummyvar function to the GNU Octave statistics package, providing MATLAB-compatible one-hot encoding for numeric and categorical grouping variables.

The implementation:

  • Supports numeric vectors and categorical arrays, with column order defined by categories(g) for categorical inputs.
  • Treats categorical values consistently with numeric NaN, producing rows of zeros rather than NaN, ensuring safe use in downstream numeric workflows.
  • Uses vectorized assignment with sub2ind for efficiency and clarity.
  • Includes explicit single-column validation for categorical and table inputs, following Octave API conventions.
  • Adheres to Octave style guidelines for argument checking, error messaging, and BIST coverage.

@Pasta-coder Pasta-coder marked this pull request as ready for review December 30, 2025 08:04
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