重构分类流水线:提升可扩展性与可读性#1
Open
stap1e wants to merge 2 commits into
Open
Conversation
- Extract shared training flow into pipeline/experiment.py - Add ExperimentConfig and classifier factory for extensibility - Slim classify_lab1, classify_single, classify_kfold entry scripts - Centralize radiomics drop columns and add README/requirements - Fix k-fold CPC labels to match lab1 (CPC 1-2=0, 3-5=1) Co-authored-by: glik <stap1e@users.noreply.github.com>
- Add config/experiments.yaml with lab1, single, kfold, kfold_nse profiles
- Load paths via CLS_DATA_ROOT, CLS_RESULTS_ROOT and {data_root} placeholders
- Unified CLI (--profile, --list-profiles) via config/cli.py and run_experiment.py
- Fix k-fold to split raw rows before preprocessing so NSE is preserved per fold
- Add classify_kfold_nse.py entry script and PyYAML dependency
Co-authored-by: glik <stap1e@users.noreply.github.com>
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.
背景
原仓库中
classify_*.py存在大量重复代码,路径硬编码在脚本内,且 K 折流程在划分前剥离了 NSE 列,导致无法做「K 折 + NSE」实验。主要改动
模块化流水线(上一轮)
config/ExperimentConfig、models/factory.py、pipeline/experiment.pyrun_experiment()路径配置外置(本轮)
config/experiments.yaml:定义lab1/single/kfold/kfold_nse等 profileCLS_DATA_ROOT、CLS_RESULTS_ROOT、CLS_EXPERIMENTconfig/load_config.py:解析${VAR:-default}与{data_root}占位符run_experiment.py、--profile/--list-profiles/-c自定义 YAMLK 折 + NSE(本轮)
prepare_labeled_frames→ LASSO → NSE 拼接classify_kfold_nse.py与 profilekfold_nse使用示例
Windows:
配置文件
编辑
code/cls/config/experiments.yaml即可增删 profile,无需改 Python。