Skip to content

nearmiss_impl() error message uses bsmote-specific 'danger observations' terminology #188

Description

@EmilHvitfeldt

Issue

nearmiss_impl() in R/nearmiss_impl.R produces a confusing error message that borrows terminology from the BSMOTE algorithm:

cli::cli_abort(
  "Not enough danger observations of {.val {names(classes)[i]}} to perform NEARMISS."
)

"Danger observations" is specific to BSMOTE, where points are classified into "danger" and "safe" zones. It has no meaning in the context of NearMiss, which is a distance-based undersampling algorithm. A user hitting this error would find the message confusing and potentially misleading.

Fix

Replace with a message appropriate to NearMiss, e.g.:

cli::cli_abort(
  "Not enough observations in the other classes to compute {k} nearest neighbors \\
  for {.val {names(classes)[i]}}."
)

Metadata

Metadata

Assignees

No one assigned

    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