Skip to content

Batched categorical kernel transform merges different categories #625

Description

@AHMETHAKANBEZIR1

On current master af8b928, CategoricalParameter("x", ["a", "b", "c"]).kernel_transform(np.eye(3)) returns a 3x3 matrix of ones rather than identity. res[:, argmax(value, axis=1)] sets all selected columns in every row. For an RBF wrapped kernel this makes every pair of distinct categories identical (covariance 1 rather than exp(-1)), so a GP cannot distinguish them. Use paired row and category indices. A focused test checks mixed/repeated categories, square and rectangular wrapped-kernel reference values and the single-row control. The current test fails on untouched master. Searches of open/closed categorical kernel, kernel_transform and one-hot reports found no overlapping open PR; #601 concerns max conversion and #597 combined kernels.

AI assistance: Codex autonomously reproduced the issue and prepared the fix; no independent human review has occurred.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions