SuperAPI AI 工具集

lasso-logistics-analysis

通用与其它

查看项目

更新于 10-15 16:44

技能介绍

用途:从表达矩阵或其他组学特征矩阵出发,用 LASSO 逻辑回归和交叉验证构建二分类模型,并做嵌入式特征选择。

主要能力:以 alpha=1 的 binomial glmnet 模型拟合,用 cv.glmnet 在指定折数下选择 lambda,提取 lambda.min 处系数;支持可选特征面板过滤;输出 coefficient.csv、feature_matrix.csv、selected_features.txt、missing_features.txt、交叉验证曲线与系数路径 PDF、session_info.txt。

使用方式:命令行运行 Rscript scripts/main.R,必填参数为 --input_file(特征为行、样本为列)、--group_file(含 sample 与 group 列)、--case_group、--control_group;可选 --feature、--nfolds(3/5/7/10,默认 10)、--cv_title、--path_title、--timeout_seconds(默认 1800)、--output_dir、--seed(默认 42)。示例:Rscript scripts/main.R -i ./expression_matrix.csv -g ./groups.csv -c case -t control -o ./output。

适用场景:组学特征矩阵的二分类建模与特征筛选。限制:需安装所需 R 包;两类各至少 2 个样本;样本 ID 须完全匹配;错误以 SKILL_* 代码提示,超时可调大 --timeout_seconds 或减少特征数。具体算法细节见 references/algorithm.md,排错见 references/troubleshooting.md。