Skip to content
Agentmart
Submit a tool

逐题求解

按求解计划逐题编写Python代码求解,包含数据预处理、建模、求解、画图、灵敏度分析

Skill by hongdotien10-hash

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/hongdotien10-hash-c47812

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

按求解计划逐题编写Python代码求解,包含数据预处理、建模、求解、画图、灵敏度分析

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/mrite-code

What's inside

Skill name
逐题求解
Description
按求解计划逐题编写Python代码求解,包含数据预处理、建模、求解、画图、灵敏度分析
License
MIT
Instructions
243 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • name: only lowercase letters, digits and single hyphens allowed
  • name: "逐题求解" does not match folder "mrite-code"

Files (1)

  • SKILL.md

SKILL.md (first lines)

# 逐题求解

## 目的

为每个子问题编写Python求解脚本,先算后画,每题至少4-6张图,完成灵敏度分析。

## 代码结构(每个问题一个py文件)

### 文件命名与位置

```
求解/
├── 问题一/
│   ├── 问题一_<描述>.py
│   ├── 图片/
│   └── 结果/
├── 问题二/
│   ...
```

### 公共头部(每个脚本复制)

```python
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os, warnings
warnings.filterwarnings('ignore')

# 中文字体(跨平台)
plt.rcParams['font.sans-serif'] = ['STHeiti', 'SimHei', 'Heiti TC',
    'Arial Unicode MS', 'Hiragino Sans GB', 'PingFang SC',
    'Microsoft YaHei', 'Songti SC', 'DejaVu Sans']
plt.rcParams['axes.unicode_minus'] = False
plt.rcParams['figure.dpi'] = 150
plt.rcParams['savefig.dpi'] = 150
plt.rcParams['savefig.bbox'] = 'tight'

def despine(ax):
    ax.spines['top'].set_visible(False)
    ax.spines['right'].set_visible(False)

BASE_DIR = os.path.dirname(os.path.abspath(__file__))
FIG_DIR = os.path.join(BASE_DIR, '图片')
OUT_DIR = os.path.join(BASE_DIR, '结果')
os.makedirs(FIG_DIR, exist_ok=True)
os.makedirs(OUT_DIR, exist_ok=True)

def save_fig(fig, name_cn):
    fig.savefig(os.path.join(FIG_DIR, name_cn))
    plt.close(fig)

def save_csv(df, name_cn):
    df.to_csv(os.path.join(OUT_DIR, name_cn), index=False, encoding='utf-8-sig')
```

## 两阶段执行(严格执行)

### 第一阶段:纯计算

```
数据加载 → 预处理 → 建模 → 求解 → 得到所有数值结果
```

**必须打印的统计量**(供论文引用):
```python
def print_stats(data, name):
    print(f"\n=== {name} 统计 ===")
    print(f"样本数: {len(data)}")
    print(f"最小值: {data.min():.4f}")
    print(f"最大值: {data.max():.4f}")
    print(f"均值: {data.mean():.4f}")
    print(f"标准差: {data.std():.4f}")
    print(f"变异系数(CV): {data.std()/data.mean():.4f}")
    print(f"振幅: {data.max()-data.min():.4f}")
```

### 第二阶段:检查 + 绘图

在确认所有计算结果正确后,再进行画图。

## 各类型问题的建模模板

### 优化类
```python
# 步骤1:目标函数的建立
# 步骤2:约束条件的建立(逐个约束编号)
# 步骤3:核心机理建模(子模型)
# 步骤4:求解算法实现

from scipy.optimize import minimize, differential_evolution
# 或使用遗传算法、粒子群等
```

### 评价类
```python
# 步骤1:评价指标体系构建
# 步骤2:指标权重确定(熵权法/AHP)
# 步骤3:综合评价(TOPSIS/模糊综合评价)

from sklearn.preprocessing import MinMaxScaler
# 熵权法计算权重
def entropy_weight(matrix):
    # 归一化
    p = matrix / matrix.sum(axis=0)
    # 计算熵值
    e = -np.sum(p * np.log(p + 1e-10), axis=0) / np.log(len(matrix))
    # 计算权重
    w = (1 - e) / np.sum(1 - e)
    return w
```

### 分类/预测类
```python
# 步骤1:特征工程(相关性分析+降维+特征选择)
# 步骤2:模型构建(完整数学表达式)
# 步骤3:模型训练与评估(交叉验证+指标)

From hongdotien10-hash/mathmodel-toolkit, MIT.

More from hongdotien10-hash/mathmodel-toolkit

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jul 22, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from hongdotien10-hash

Cite this page

逐题求解 skill. Agent Mart. https://agentmart.dev/skills/hongdotien10-hash-c47812 (last updated 2026-10-24)