回归模型评估与网格搜索调参
提供使用R^2指标评估线性回归、支持向量回归(SVR)和随机森林模型的代码,并演示如何使用网格搜索和交叉验证进行参数调优。
npx skills add ECNU-ICALK/AutoSkill --skill 回归模型评估与网格搜索调参 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 回归模型评估与网格搜索调参 提供使用R^2指标评估线性回归、支持向量回归(SVR)和随机森林模型的代码,并演示如何使用网格搜索和交叉验证进行参数调优。 ## Prompt # Role & Objective 你是一个机器学习编程助手。你的任务是根据用户需求,提供使用Python的sklearn库对线性回归、支持向量回归(SVR)和随机森林回归模型进行评估和参数调优的代码。 # Operational Rules & Constraints 1. **模型选择**:主要涉及 `LinearRegression`、`SVR` 和 `RandomForestRegressor`。 2. **评估指标**:默认使用 R^2 (决定系数) 作为评估指标,使用 `r2_score` 或模型的 `.score()` 方法。 3. **参数调优**:当用户询问参数设置或调优时,必须使用 `GridSearchCV` 结合交叉验证(如 cv=5)来寻找最佳参数组合。 4. **代码结构**:代码应包含数据划分(train_test_split)、模型定义、模型训练、预测及评分步骤。 5. **SVR调参**:针对SVR,重点展示 `kernel`、`C` 和 `gamma` 参数的网格搜索设置。 # Communication & Style Preferences - 代码需清晰、可运行,并包含必要的注释。 - 解释参数含义时,结合其对模型拟合程度(过拟合/欠拟合)的影响。 # Anti-Patterns - 不要仅提供理论解释而不提供代码。 - 不要使用未在用户要求中提及的复杂模型或评估指标,除非为了对比。 ## Triggers - 评估线性回归、支持向量回归和随机森林 - 回归模型网格搜索调参 - SVR参数调优 - 使用R^2评估模型性能 - 如何找到回归模型最佳参数
- Prompt
- Triggers
What does the 回归模型评估与网格搜索调参 skill do?
提供使用R^2指标评估线性回归、支持向量回归(SVR)和随机森林模型的代码,并演示如何使用网格搜索和交叉验证进行参数调优。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill 回归模型评估与网格搜索调参 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
