Skip to content

Return type changes depending on user input; this is surprising and likely to break code #23

Description

@st--

The data returned by ScatterWidget depends on user input, specifically whether the user only ever added points of one, or of more colors:

  • one color only ("regression style"): widget.data_as_X_y returns X as an [N,1] shaped array of x coordinates and y as an [N] shaped array (vector) of y coordinates
  • two+ colors ("classification style"): widget.data_as_X_y returns X as an [N,2] shaped array of x and y coordinates and y as an [N] shaped array of labels

It's great that the widget supports both regression and classification, but this makes it hard to build notebooks on top of it. Generally, I would want to handle both very differently. It would be great to be able to enforce at widget creation time that I
(a) only want regression (and then don't provide the radio buttons for classes) or
(b) only want classification (in which case always return X as [N,2] array and y as [N] array with labels, even if there is only a single class).

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions