Skip to contents

Low-level engine for multiclass (C >= 3) Optimal Data Analysis. Handles ordered and categorical attributes. Most users should call oda_fit instead.

Usage

oda_multiclass_unioda_core(x, y, w = NULL,
  attr_type = c("auto","ordered","categorical","binary"),
  priors_on = TRUE, miss_codes = NULL, missing_code = NULL,
  K_segments = NULL, degen = FALSE,
  mcarlo = TRUE, mc_iter = 25000L, mc_target = 0.05,
  mc_stop = 99.9, mc_stopup = NA, mc_adjust = FALSE, mc_seed = NULL,
  loo = c("off","on"),
  boundary_mode = c("megaoda_halfopen","right_closed"),
  loo_opts = list(),
  direction = "off", direction_map = NULL)

Arguments

x

Attribute values (numeric or factor).

y

Integer class labels (will be re-coded to 1..C internally).

w

Optional numeric case weights.

attr_type

Attribute type.

priors_on

Inverse-frequency weighting.

miss_codes

Additional missing codes (scalar or vector).

missing_code

Alias for miss_codes.

K_segments

Number of segments; default = C.

degen

Allow degenerate solutions?

mcarlo

Run Monte Carlo p-value?

mc_iter, mc_target, mc_stop, mc_stopup, mc_adjust, mc_seed

MC parameters.

loo

"off" or "on".

boundary_mode

Boundary convention for ordered cut values.

loo_opts

Named list of LOO options passed to the LOO engine.

direction

Directional constraint (MPE Chapter 4). "ascending" forces segment s to class s for ordered multiclass; auto-creates identity direction_map for categorical when L == C. "descending" uses reverse assignment. Default "off" (nondirectional).

direction_map

Named integer vector for categorical fixed-partition DIRECTIONAL. Names are attribute levels; values are class labels 1..C. When supplied, bypasses the partition search and evaluates only the specified mapping. Default NULL.

Value

Named list. Key fields: ok, rule (with cut_values and seg_classes), confusion (weighted count matrix), pac, mean_pac, ess_pac, p_mc, loo, n_eff.

Note on confusion matrix: confusion contains weighted counts (priors-adjusted when priors_on = TRUE). For raw integer counts use loo$confusion_raw.

See also