Skip to content

Binary categories aren't handled correctly #6

@sepro

Description

@sepro

When only two label/categories are present, this isn't handled correctly

One suggestion was to update the plot_area function as shown below.

if (length(levels(data[[y]])) > 2) {
    # Multinomial case
    predicted_probabilities <- Effect(x, mnom_model, xlevels = 300)
    plot_data <- as.data.frame(predicted_probabilities)
  } else {
    # Binary case - still using multinom for consistency
    new_data <- data.frame(x = seq(min(data[[x]]), max(data[[x]]), length.out = 300))
    predicted_probabilities <- predict(mnom_model, newdata = new_data, type = "probs")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions