# AutoMLR Parameter Defaults

This file records the user-facing defaults recommended for the current
survival AutoML workflow. The design principle is to keep C-index as the
primary selection criterion while exporting stability, failure-rate,
time-dependent AUC, and complexity diagnostics for interpretation.

## Global Parameters

| Function | Parameter | Default | User-facing meaning |
| --- | --- | --- | --- |
| `automlr_parameters()` | `seed` | `123L` | Base random seed. |
| `automlr_parameters()` | `algorithms` | all registered algorithms | Runs the 10 survival algorithm families, expanded to about 18 default variants. |
| `automlr_parameters()` | `eval_times` | `c(365, 1095, 1825)` | Time points for 1-, 3-, and 5-year style AUC / ROC output. |
| `automlr_parameters()` | `time_unit` | `"auto"` | Plot-label unit for survival time and `eval_times`; can be set to `"days"`, `"months"`, or `"years"`. |
| `automlr_parameters()` | `surv_svm_resampling` | `"kfold"` | Evaluates survival-SVM candidates with k-fold resampling by default to avoid single-row prediction issues in `survivalsvm` LOOCV. |
| `automlr_parameters()` | `surv_svm_k_folds` | `5L` | Number of folds used for survival-SVM when `surv_svm_resampling = "kfold"`. |
| `automlr_parameters()` | `n_cores` | `1L` | Sequential default for CRAN-safe reproducibility. |
| `automlr_parameters()` | `stability_resamples` | `0L` | Extra resampling stability is off by default to save time. |
| `automlr_parameters()` | `stability_fraction` | `0.80` | Fraction used when optional stability resampling is enabled. |
| `automlr_parameters()` | `min_cindex_accept` | `0.60` | Threshold strategy acceptance cutoff. |
| `automlr_parameters()` | `auto_min_cindex` | `FALSE` | Optional automatic C-index cutoff for threshold strategy, computed after candidate LOOCV. |
| `automlr_parameters()` | `auto_quantile` | `0.50` | Candidate-metric quantile used when automatic thresholding is enabled; larger values are more selective. |

## Regular Ensemble Analysis

| Function | Parameter | Default | User-facing meaning |
| --- | --- | --- | --- |
| `fit_surv_ensemble()` | `strategy` | `"best_subset"` | Enumerates candidate model subsets and chooses the best by C-index. |
| `fit_surv_ensemble()` | `min_models` | `1L` | Includes single models in the final ranking. |
| `fit_surv_ensemble()` | `max_models` | `2L` | Searches single models and two-model combinations by default. |
| `fit_surv_ensemble()` | `weight_method` | `"cindex"` | Weights combination members by C-index-derived weights. |
| `fit_surv_ensemble()` | `allow_same_algorithm` | `FALSE` | Avoids combining multiple variants from the same base algorithm. |
| `fit_surv_ensemble()` | `max_failed_fraction` | `0.20` | Filters unstable candidates with too many failed folds. |
| `fit_surv_ensemble()` | `rank_by` | `"cindex"` | Keeps C-index as the primary selection criterion. |
| `fit_surv_ensemble()` | `diagnostic_times` | `NULL` | Combination-table time AUC diagnostics are optional; report-level AUC uses `eval_times`. |

## Regular Result Export

| Function | Parameter | Default | User-facing meaning |
| --- | --- | --- | --- |
| `render_surv_report()` | `top_n` | `20L` | Number of top rows shown in the HTML report. |
| `export_surv_results()` | `top_n` | `20L` | Number of top rows emphasized in tables and figures. |
| `export_surv_results()` | `formats` | `c("pdf", "png")` | Exports publication and preview figure formats. |
| `export_surv_results()` | `dpi` | `300L` | PNG resolution for publication-style figures. |
| `export_surv_results()` | `publication` | `TRUE` | Writes the final deduplicated publication figure set. |
| `export_surv_results()` | `summary_language` | `"bilingual"` | Writes English first, then Chinese, in Markdown summaries. |
| `export_surv_results()` | `overwrite` | `TRUE` | Re-running an analysis overwrites old report files. |

## Extreme Screening

| Function | Parameter | Default | User-facing meaning |
| --- | --- | --- | --- |
| `extreme_surv_screen()` | `top_n` | `5L` | Carries the top apparent combinations into seed search. |
| `extreme_surv_screen()` | `seeds` | `1:500` | Runs 500 train/validation split seeds by default. |
| `extreme_surv_screen()` | `train_fraction` | `0.70` | Uses 70% training and 30% validation per seed. |
| `extreme_surv_screen()` | `min_models` | `1L` | Apparent stage includes single models. |
| `extreme_surv_screen()` | `max_models` | `2L` | Apparent stage searches single models and two-model combinations. |
| `extreme_surv_screen()` | `weight_method` | `"cindex"` | Weights combination members by apparent C-index-derived weights. |
| `extreme_surv_screen()` | `allow_same_algorithm` | `FALSE` | Avoids combining multiple variants from the same base algorithm. |
| `extreme_surv_screen()` | `min_risk_sd` | `1e-8` | Filters near-constant risk scores before combination search. |
| `extreme_surv_screen()` | `rank_by` | `"apparent_cindex"` | Apparent top-N is selected by pooled apparent C-index. |

## Extreme Screening Export

| Function | Parameter | Default | User-facing meaning |
| --- | --- | --- | --- |
| `export_extreme_screen_results()` | `top_n` | `10L` | Highlights the top apparent combinations in figures. |
| `export_extreme_screen_results()` | `top_seed_rows` | `30L` | Shows the top 30 seed-search rows in ranked outputs. |
| `export_extreme_screen_results()` | `formats` | `c("png", "pdf")` | Exports preview and publication figure formats. |
| `export_extreme_screen_results()` | `dpi` | `300L` | PNG resolution for figures. |
| `export_extreme_screen_results()` | `summary_language` | `"bilingual"` | Writes English first, then Chinese, in `summary_report.md`. |

## 中文说明

- 常规组合模型默认搜索 `min_models = 1`, `max_models = 2`，因此用户可以同时比较最佳单模型和最佳双模型组合。
- 默认候选池维持约 18 个 model variant，避免组合池过大导致计算时间失控。
- 生存时间单位默认自动判断；若原始数据明确为天、月或年，建议用户显式设置 `time_unit`。
- `surv_svm` 默认使用 k-fold 外层评估，避免 `survivalsvm` 在 LOOCV 单样本预测时返回空结构导致 C-index 为 NA；如需旧行为可设置 `surv_svm_resampling = "loocv"`。
- 默认绘图会过滤全 NA 的热图行，部分 NA 会以灰色 `NA` 格子标注；热图色阶、forest 横坐标和残差直方图坐标会根据有限数据动态计算。
- 常规分析和极限筛选都默认输出中英双语总结，顺序为英文在前、中文在后。
- C-index 始终作为主要筛选指标；队列稳定性、time-dependent AUC、失败率和模型复杂度作为解释和核查指标输出。
- 极限筛选的 apparent performance 是乐观拟合内表现，只用于探索上限，不能当作外部验证性能。

## Binary Classification Workflow

| Function | Parameter | Default | User-facing meaning |
| --- | --- | --- | --- |
| `binarymlr_parameters()` | `algorithms` | all registered binary algorithms | Expands to 18 default binary model variants. |
| `binarymlr_parameters()` | `resampling` | `"loocv"` | Uses LOOCV by default; `"kfold"` and `"repeated_kfold"` are available for larger data. |
| `binarymlr_parameters()` | `k_folds` | `5L` | Number of folds when k-fold resampling is selected. |
| `binarymlr_parameters()` | `repeats` | `1L` | Number of repeats for repeated k-fold resampling. |
| `binarymlr_parameters()` | `min_auc_accept` | `0.60` | Threshold-strategy acceptance cutoff for ROC AUC. |
| `binarymlr_parameters()` | `auto_min_auc` | `FALSE` | Optional automatic AUC cutoff for threshold strategy. |
| `binarymlr_parameters()` | `auto_quantile` | `0.50` | Candidate-metric quantile used when automatic thresholding is enabled; larger values are more selective. |
| `binarymlr_parameters()` | `threshold_methods` | `c("youden", "fixed_0.5")` | Threshold summaries exported for class-label interpretation. |
| `binarymlr_parameters()` | `missing_fraction_cutoff` | `0.20` | Drops features with more than 20% missing values before modeling. |
| `binarymlr_parameters()` | `screen_by_variance` | `TRUE` | Drops zero-variance features before modeling. |
| `binarymlr_parameters()` | `variance_quantile_cutoff` | `0` | Optional lower variance quantile to remove when users want stronger screening. |
| `binarymlr_parameters()` | `standardize_features` | `FALSE` | Optional centering / scaling before model fitting. |
| `fit_binary_ensemble()` | `min_models` | `1L` | Includes single models in the combination ranking. |
| `fit_binary_ensemble()` | `max_models` | `2L` | Searches single models and two-model probability combinations by default. |
| `fit_binary_ensemble()` | `weight_method` | `"auc"` | Weights members by AUC-derived weights. |
| `fit_binary_ensemble()` | `allow_same_algorithm` | `FALSE` | Avoids combining multiple variants from the same base algorithm. |
| `fit_binary_ensemble()` | `rank_by` | `"auc"` | Keeps ROC AUC as the primary binary selection criterion. |
| `export_binary_results()` | `publication` | `TRUE` | Writes binary publication figures and audit tables. |
| `export_binary_results()` | `summary_language` | `"bilingual"` | Writes English first, then Chinese, in Markdown summaries. |

中文补充：

- 二分类流程默认以 ROC AUC 作为主筛选指标，PR-AUC、Brier、阈值指标、校准、DCA 和队列稳定性作为解释与核查输出。
- 默认候选池为 18 个 model variant；默认搜索单模型和双模型概率组合，且不组合相同算法家族的不同 variant。
- `prepare_binary_cohort_input()` 现在默认拒绝多分类标签的静默折叠；只有显式设置 `collapse_other = TRUE` 时，才会把非阳性类别合并为阴性。
- 默认导出区分 apparent probability 与 OOF probability；筛选和主要诊断默认使用 OOF probability。

## Continuous Outcome Workflow

| Function | Parameter | Default | User-facing meaning |
| --- | --- | --- | --- |
| `continuousmlr_parameters()` | `algorithms` | all registered continuous algorithms | Expands to 18 default regression model variants. |
| `continuousmlr_parameters()` | `resampling` | `"loocv"` | Uses LOOCV by default; `"kfold"` and `"repeated_kfold"` are available. |
| `continuousmlr_parameters()` | `k_folds` | `5L` | Number of folds when k-fold resampling is selected. |
| `continuousmlr_parameters()` | `repeats` | `1L` | Number of repeats for repeated k-fold resampling. |
| `continuousmlr_parameters()` | `min_r2_accept` | `0` | Threshold-strategy acceptance cutoff for R-squared. |
| `continuousmlr_parameters()` | `auto_min_r2` | `FALSE` | Optional automatic R-squared cutoff for threshold strategy. |
| `continuousmlr_parameters()` | `auto_quantile` | `0.50` | Candidate-metric quantile used when automatic thresholding is enabled; larger values are more selective. |
| `continuousmlr_parameters()` | `missing_fraction_cutoff` | `0.20` | Drops features with more than 20% missing values before modeling. |
| `continuousmlr_parameters()` | `screen_by_variance` | `TRUE` | Drops zero-variance features before modeling. |
| `continuousmlr_parameters()` | `standardize_features` | `FALSE` | Optional centering / scaling before model fitting. |
| `fit_continuous_ensemble()` | `min_models` | `1L` | Includes single models in the combination ranking. |
| `fit_continuous_ensemble()` | `max_models` | `2L` | Searches single models and two-model prediction combinations by default. |
| `fit_continuous_ensemble()` | `weight_method` | `"inverse_rmse"` | Weights members by inverse RMSE by default. |
| `fit_continuous_ensemble()` | `allow_same_algorithm` | `FALSE` | Avoids combining multiple variants from the same base algorithm. |
| `fit_continuous_ensemble()` | `rank_by` | `"rmse"` | Keeps out-of-fold RMSE as the primary continuous-outcome selection criterion. |
| `export_continuous_results()` | `publication` | `TRUE` | Writes continuous publication figures and audit tables. |

中文补充：

- 连续结局默认以 OOF RMSE 作为主筛选指标；MAE、R-squared、Pearson、Spearman 和队列表现作为解释与核查输出。
- 默认候选池为 18 个 regression variant；默认搜索单模型和双模型预测值组合。

## Ordinal Outcome Workflow

| Function | Parameter | Default | User-facing meaning |
| --- | --- | --- | --- |
| `ordinalmlr_parameters()` | `algorithms` | all registered ordinal algorithms | Expands to 18 default ordinal score-regression variants. |
| `ordinalmlr_parameters()` | `resampling` | `"loocv"` | Uses LOOCV by default; `"kfold"` and `"repeated_kfold"` are available. |
| `ordinalmlr_parameters()` | `k_folds` | `5L` | Number of folds when k-fold resampling is selected. |
| `ordinalmlr_parameters()` | `repeats` | `1L` | Number of repeats for repeated k-fold resampling. |
| `ordinalmlr_parameters()` | `min_qwk_accept` | `0` | Threshold-strategy acceptance cutoff for quadratic weighted kappa. |
| `ordinalmlr_parameters()` | `auto_min_qwk` | `FALSE` | Optional automatic QWK cutoff for threshold strategy. |
| `ordinalmlr_parameters()` | `auto_quantile` | `0.50` | Candidate-metric quantile used when automatic thresholding is enabled; larger values are more selective. |
| `ordinalmlr_parameters()` | `missing_fraction_cutoff` | `0.20` | Drops features with more than 20% missing values before modeling. |
| `ordinalmlr_parameters()` | `screen_by_variance` | `TRUE` | Drops zero-variance features before modeling. |
| `ordinalmlr_parameters()` | `standardize_features` | `FALSE` | Optional centering / scaling before model fitting. |
| `fit_ordinal_ensemble()` | `min_models` | `1L` | Includes single models in the combination ranking. |
| `fit_ordinal_ensemble()` | `max_models` | `2L` | Searches single models and two-model ordinal-score combinations by default. |
| `fit_ordinal_ensemble()` | `weight_method` | `"qwk"` | Weights members by QWK-derived weights by default. |
| `fit_ordinal_ensemble()` | `allow_same_algorithm` | `FALSE` | Avoids combining multiple variants from the same base algorithm. |
| `fit_ordinal_ensemble()` | `rank_by` | `"qwk"` | Keeps out-of-fold QWK as the primary ordinal-outcome selection criterion. |
| `export_ordinal_results()` | `publication` | `TRUE` | Writes ordinal publication figures and audit tables. |

中文补充：

- 等级结局默认以 OOF quadratic weighted kappa 作为主筛选指标；accuracy、balanced accuracy、class MAE、score RMSE 和 Spearman 作为解释与核查输出。
- 用户应尽量显式提供 `ordered_levels`，避免字符型等级被按字母顺序解释。
