Skip to contents

Select the best K-segment ordered partition by MegaODA spec: PRIMARY -> SECONDARY -> FIRST IDENTIFIED (enum order via tick()).

Usage

oda_best_ordered_multiclass_partition(
  x_rep,
  counts_obj,
  counts_raw,
  K,
  priors_on_eff = TRUE,
  degen = FALSE,
  primary = NULL,
  secondary = NULL,
  cut_value_mode = c("midpoint", "lower", "upper"),
  debug_return_ties = FALSE,
  debug_max_ties = 200L,
  direction = "off"
)

Arguments

x_rep

Representative x value per unique block.

counts_obj

m x C count matrix in objective (priors-weighted) space.

counts_raw

m x C count matrix in raw (case-weight) space.

K

Number of segments (cuts = K-1).

priors_on_eff

Logical.

degen

Allow degenerate solutions?

primary, secondary

Heuristic strings (NULL = spec defaults).

cut_value_mode

"midpoint", "lower", or "upper".

debug_return_ties

Return all primary-tied candidates for diagnostics.

debug_max_ties

Cap on number of ties stored.

direction

Directional constraint (MPE Chapter 4 ordered DIRECTIONAL). "ascending" forces segment s to map to class s; "descending" forces class C+1-s. Default "off" (nondirectional; all assignments evaluated).

Value

List with ok, cuts_idx, cut_values, seg_cls_idx, primary_obj, secondary_obj, best_enum_id, ties, classes.