Repository navigation
16/ One registry of classifiers and feature selection methods (no change to results) - #142
Draft
ellispatrick wants to merge 1 commit into
Draft
ellispatrick wants to merge 1 commit into
ellispatrick wants to merge 1 commit into
Conversation
ellispatrick
force-pushed
the
review/16-registry
branch
from
October 10, 2026 22:47
521e1ae to
cea9250
Compare
…to results) - R/registry.R holds one entry per classifier and selection keyword: its functions, display name, description, the outcomes it accepts (classes, survival or both), tuning presets, default parameters and the fallback when an assay has too few features. It is built when the package loads. - The keyword tables of available(), the keyword-to-function and keyword-to-parameters mappings, the display names of results and plots and the penalised GLM's fallback to an ordinary GLM are read from it. simpleParams.R and the tables in constants.R are removed. - available() gains an Outcomes column. crossValidate stops early with a clear error when a classifier or selection method does not accept the kind of outcome, instead of every cross-validation failing. - R/interfaceTemplate.R states the contract of training, prediction, feature and ranking functions. The developer vignettes describe adding a method with one registry entry. - A test fits and predicts every registered keyword for each outcome it accepts and checks the prediction format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4
ellispatrick
force-pushed
the
review/15-defaults-deps
branch
from
October 14, 2026 00:20
21cdab9 to
607e88e
Compare
ellispatrick
force-pushed
the
review/16-registry
branch
from
October 14, 2026 00:20
cea9250 to
3823b1b
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
No change to results. Every classifier and feature selection method now has one entry in a registry,
R/registry.R. Adding a method takes:Collateline;It used to touch up to nine places.
Why
Ellis Patrick's decision on Q36 ("Yes"), ProjectClassifyR
docs/DECISIONS.md, 10 October 2026, followingdocs/MAINTAINABILITY.mdsection 6. Before this, adding a classifier meant editing:Collate;constants.R:functionsTableandclassifyKeywords;utilities.R:.classifierKeywordToParams;simpleParams.R, for a*params()function and its tuning presets;cleanClassifier's hard-coded penalised-GLM list;Nothing recorded whether a method accepts classes, survival or both.
What changes
R/registry.R:.registerClassifier()and.registerSelection()entries, built in.onLoad, so file order doesn't matter. Each entry gives:GLM).available()'s tables;simpleParams.R;constants.R.available()gains an Outcomes column (classes, survival or both).crossValidatestops at once with a clear error when a classifier or selection method doesn't accept the outcome, e.g. "CoxPH can't be used with classes". Before, every cross-validation failed and the error was reported afterwards.R/interfaceTemplate.Rstates the interface contract (arguments, prediction formats, feature extractors). The developer vignettes describe adding a method with a registry entry.test-registry.Rfits and predicts every registered keyword for each outcome it accepts, and checks the prediction format. A new method is tested by adding its entry.Evidence
Same machinery as before: against 15/ Defaults and dependencies: no rebalancing and serial by default; five packages to Imports, three dropped #141's build, these are identical:
available()'s keywords and descriptions;TrainParams/PredictParamsof every classifier keyword withtuneParams=NULL,"auto"or a list;(ProjectClassifyR
scripts/structure/registry_evidence.R.)Regression harness: all 18 scenarios are identical to 15/ Defaults and dependencies: no rebalancing and serial by default; five packages to Imports, three dropped #141's build, including the characteristics recorded in results.
Tests and check: R CMD check (tests, examples, vignettes) gives the same single NOTE as 15/ Defaults and dependencies: no rebalancing and serial by default; five packages to Imports, three dropped #141, the undeclared global variables of the plotting code. Its test run passes 526 expectations, none failing.
🤖 Generated with Claude Code
https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4