Skip to content

Register C5.0 and Cubist engine arguments; pass C5.0Control() args to the control object - #99

Merged
topepo merged 5 commits into
mainfrom
register-engine-args
Nov 9, 2026
Merged

topepo merged 5 commits into
mainfrom
register-engine-args

Conversation

@topepo

@topepo topepo commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Registrations. Engine arguments are now registered with parsnip::set_model_arg(), replacing the custom tunable.C5_rules() and tunable.cubist_rules() methods (and c5_rules_engine_args / add_engine_parameters()).

  • C5_rules() / C5.0: CF (confidence_factor()), noGlobalPruning (no_global_pruning()), winnow (predictor_winnowing()), fuzzyThreshold (fuzzy_thresholding()), bands (rule_bands()).
  • cubist_rules() / Cubist: extrapolation (extrapolation()), unbiased (unbiased_rules()).
  • Non-default main-argument ranges from the old methods moved into the registrations:
    • C5.0 trees: c(1, 100).
    • C5.0 min_n: c(2, 40).
    • Cubist committees: c(1, 100).
    • Cubist neighbors: c(0, 9).

The engine arguments now always appear in tunable() with component_id = "engine", as with other parsnip engines. Previously they appeared only if one was already marked tune().

Bug fix in c5_fit(). Engine arguments such as CF or winnow were passed to C50::C5.0() directly, which ignores them, so tuning them had no effect. They are now put into C50::C5.0Control().

  • An explicit control argument is now actually modified (minCases, default seed, earlyStopping = FALSE). Previously the modification was applied to the quosure and lost.
  • Defaults are no longer dropped when other engine args are supplied.
  • If both control and control engine arguments are passed, the engine arguments overwrite the matching elements of control. A warning is issued when the control value was not the default (i.e., it was specified twice). seed is overwritten silently since its default is random.

Bug fix for cost in c5_fit(). A misplaced parenthesis (length(levels(y) != 2)) made any cost value error, even for two-class outcomes. The cost matrix now also gets dimnames from the factor levels, which silences a C50 warning. Tests added for both the two-class and multiclass cases.

Test fix. The Cubist "argument/call assembly" tests now derive their expected control lists from Cubist::cubistControl(). They had hard-coded the fields, and failed on main once Cubist added strip_time_stamps.

@topepo
topepo merged commit c93d505 into main Nov 9, 2026
4 checks passed
@topepo
topepo deleted the register-engine-args branch November 9, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant