Install any skill in seconds. Free to start, no credit card required.
Get Started Free →基于多维度数据进行分级评估与趋势预测,通过设定差异化增长率计算预测值,并生成对比可视化图表,适用于绩效评估、目标设定等场景。
.claude/skills/opensensenova-trend-analysis/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 38% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-09 | ✓→✓ | = Same ✓ | 103% | 0% |
Step1 加载数据并配置环境,设置中文字体以确保可视化图表正常显示。
pythonimport pandas as pd import numpy as np import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore') # 设置中文字体,优先使用 WenQuanYi Zen Hei,备选 SimHei 和 DejaVu Sans plt.rcParams['font.sans-serif'] = ['WenQuanYi Zen Hei', 'SimHei', 'DejaVu Sans'] plt.rcParams['axes.unicode_minus'] = False # 加载数据文件 file_path = 'your_data.xlsx' df = pd.read_excel(file_path) print(f"数据形状: {df.shape}") df.head()
Step2 基于数据表现划分等级并设定差异化增长率,计算预测结果。
python# 定义通用列名 group_col = '分组列名' # 示例:'部门'、'产品线' target_col = '目标数值列名' # 示例:'销售额'、'产量' # 计算各维度的总值并排序 performance_data = df.groupby(group_col, as_index=False)[target_col].sum().sort_values(by=target_col, ascending=False) # 划分等级(前30%为高,后30%为低,其余为中等) n = len(performance_data) high_perf_threshold = int(0.3 * n) low_perf_threshold = int(0.7 * n) performance_data['等级'] = '中等' performance_data.loc[:high_perf_threshold-1, '等级'] = '高' performance_data.loc[low_perf_threshold:, '等级'] = '低' # 设定预测增长率映射字典 growth_rate_map = { '高': 0.10, # 10% 增长率 '中等': 0.08, # 8% 增长率 '低': 0.15 # 15% 增长率 } performance_data['预测增长率'] = performance_data['等级'].map(growth_rate_map) # 计算预测值 = 当前值 × (1 + 增长率),保留两位小数 performance_data['预测值'] = (performance_data[target_col] * (1 + performance_data['预测增长率'])).round(2) performance_data[[group_col, target_col, '预测增长率', '预测值']].head()
Step3 综合分析预测结果,计算整体趋势指标并生成结论。
python# 计算整体指标 current_total = performance_data[target_col].sum() forecast_total = performance_data['预测值'].sum() growth_rate_total = (forecast_total - current_total) / current_total if current_total != 0 else 0 print(f"当前总计: {current_total:,.2f}") print(f"预测总计: {forecast_total:,.2f}") print(f"整体增长率: {growth_rate_total:.2%}") # 输出趋势结论 if growth_rate_total > 0.1: conclusion = "整体趋势向好,预计实现显著增长。" elif growth_rate_total > 0: conclusion = "整体呈温和增长态势。" else: conclusion = "整体面临压力,需重点关注低绩效部分。" print(f"趋势结论:{conclusion}")
Step4 可视化展示预测结果,通过横向柱状图对比当前与预测值,并标注等级与数值。
python# 设置图形大小与高分辨率 plt.figure(figsize=(12, 8), dpi=100) # 横向柱状图:当前与预测值对比 x_pos = np.arange(len(performance_data)) width = 0.35 plt.barh(x_pos - width/2, performance_data[target_col], width, label='当前值', color='skyblue', edgecolor='black', alpha=0.8) plt.barh(x_pos + width/2, performance_data['预测值'], width, label='预测值', color='lightcoral', edgecolor='black', alpha=0.8) # 添加数值标签 for i, (current, forecast) in enumerate(zip(performance_data[target_col], performance_data['预测值'])): plt.text(current, i - width/2, f" {current:,.0f}", va='center', fontsize=9, color='black') plt.text(forecast, i + width/2, f" {forecast:,.0f}", va='center', fontsize=9, color='black') # 添加等级标签到 Y 轴 for i, level in enumerate(performance_data['等级']): plt.text(0, i, f"({level}) ", va='center', ha='right', fontsize=9, color='gray', transform=plt.gca().get_yaxis_transform()) # 设置标题与标签 plt.xlabel(f'{target_col}') plt.ylabel(f'{group_col}') plt.title(f'各{group_col}当前与预测{target_col}对比', fontsize=14, fontweight='bold') plt.yticks(x_pos, performance_data[group_col]) plt.legend() plt.grid(axis='x', linestyle='--', alpha=0.5) # 调整布局并显示 plt.tight_layout() plt.show()
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-09 | pass→pass | 7,739 | 11,253 | +45% | 1 | 1 | 0% | 1,448 | 2,938 | +103% | 0 | 0 | — |
case-07 | fail→fail | 11,966 | 7,400 | -38% | 1 | 1 | 0% | 2,035 | 2,710 | +33% | 0 | 0 | — |
case-08 | pass→pass | 17,857 | 14,691 | -18% | 1 | 1 | 0% | 3,107 | 4,567 | +47% | 0 | 0 | — |
case-01 | fail→fail | 20,450 | 19,867 | -3% | 1 | 1 | 0% | 3,887 | 5,024 | +29% | 0 | 0 | — |
case-02 | fail→fail | 19,743 | 16,591 | -16% | 1 | 1 | 0% | 4,391 | 5,052 | +15% | 0 | 0 | — |
case-03 | fail→fail | 19,478 | 11,855 | -39% | 1 | 1 | 0% | 3,890 | 3,885 | -0% | 0 | 0 | — |
case-04 | fail→fail | 17,508 | 11,656 | -33% | 1 | 1 | 0% | 3,156 | 3,740 | +19% | 0 | 0 | — |
case-05 | fail→pass | 9,387 | 12,483 | +33% | 1 | 1 | 0% | 2,434 | 3,941 | +62% | 0 | 0 | — |
case-06 | fail→fail | 17,142 | 10,798 | -37% | 1 | 1 | 0% | 3,955 | 3,369 | -15% | 0 | 0 | — |
case-10 | fail→fail | 16,792 | 17,587 | +5% | 1 | 1 | 0% | 3,780 | 4,333 | +15% | 0 | 0 | — |
case-11 | fail→fail | 18,095 | 15,943 | -12% | 1 | 1 | 0% | 4,041 | 4,472 | +11% | 0 | 0 | — |
case-12 | fail→fail | 15,252 | 15,353 | +1% | 1 | 1 | 0% | 3,355 | 3,964 | +18% | 0 | 0 | — |
case-13 | fail→fail | 18,871 | 14,192 | -25% | 1 | 1 | 0% | 4,166 | 4,223 | +1% | 0 | 0 | — |
case-14 | fail→pass | 19,068 | 13,452 | -29% | 1 | 1 | 0% | 3,480 | 3,563 | +2% | 0 | 0 | — |
case-15 | fail→fail | 26,524 | 13,889 | -48% | 1 | 1 | 0% | 4,572 | 4,269 | -7% | 0 | 0 | — |
case-16 | fail→fail | 16,245 | 11,236 | -31% | 1 | 1 | 0% | 3,411 | 3,660 | +7% | 0 | 0 | — |
case-17 | pass→pass | 18,155 | 12,383 | -32% | 1 | 1 | 0% | 2,986 | 3,982 | +33% | 0 | 0 | — |
case-18 | pass→pass | 17,926 | 10,499 | -41% | 1 | 1 | 0% | 2,909 | 3,583 | +23% | 0 | 0 | — |
case-19 | pass→pass | 12,680 | 9,177 | -28% | 1 | 1 | 0% | 2,957 | 3,259 | +10% | 0 | 0 | — |
case-20 | fail→pass | 17,002 | 17,472 | +3% | 1 | 1 | 0% | 3,691 | 5,099 | +38% | 0 | 0 | — |
case-21 | fail→fail | 22,525 | 13,790 | -39% | 1 | 1 | 0% | 4,009 | 4,171 | +4% | 0 | 0 | — |
case-22 | fail→pass | 16,209 | 19,116 | +18% | 1 | 1 | 0% | 3,707 | 4,577 | +23% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +18 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.