基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill pareto-frontier-analysis命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Handles reading, populating, and saving .docx files using the python-docx library. Use this skill for any tasks involving template filling or modifying Word documents.
Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.
This skill includes search capability in 13F, such as fuzzy search a fund information using possibly inaccurate name, or fuzzy search a stock cusip info using its name.
| name | pareto-frontier-analysis |
| description | Identify Pareto-optimal solutions from multi-objective optimization results. |
The Pareto frontier identifies non-dominated solutions where you cannot improve one objective without worsening another. For this task: maximize F1 score and minimize delta distance.
import numpy as np
import pandas as pd
def compute_pareto_frontier(results_df):
"""
Find Pareto-optimal solutions from results.
Args:
results_df: DataFrame with columns 'f1' and 'delta'
Returns:
pareto_indices: Boolean array marking Pareto-optimal solutions
"""
f1_scores = results_df['f1'].values
deltas = results_df['delta'].values
n = len(results_df)
is_pareto = np.ones(n, dtype=bool)
for i in range(n):
# Check if solution i is dominated
for j in range(n):
if i == j:
continue
# Solution j dominates solution i if:
# - j has better F1 (higher) AND
# - j has better delta (lower)
if f1_scores[j] > f1_scores[i] and deltas[j] < deltas[i]:
is_pareto[i] = False
break
return is_pareto
def compute_pareto_frontier_fast(f1_scores, deltas):
"""Fast vectorized computation of Pareto frontier."""
n = len(f1_scores)
is_pareto = np.ones(n, dtype=bool)
# For each solution, check if any other solution dominates it
for i in range(n):
dominated = (f1_scores > f1_scores[i]) & (deltas < deltas[i])
if np.any(dominated):
is_pareto[i] = False
return is_pareto
import matplotlib.pyplot as plt
def plot_pareto_frontier(results_df, pareto_mask):
"""Visualize the Pareto frontier."""
plt.figure(figsize=(10, 6))
# Plot all points
plt.scatter(results_df[~pareto_mask]['delta'],
results_df[~pareto_mask]['f1'],
alpha=0.3, label='Dominated', s=30)
# Plot Pareto points
pareto_df = results_df[pareto_mask]
plt.scatter(pareto_df['delta'], pareto_df['f1'],
color='red', label='Pareto-optimal', s=100, marker='*')
plt.xlabel('Delta (Average Distance)')
plt.ylabel('F1 Score')
plt.title('Pareto Frontier')
plt.legend()
plt.grid(True, alpha=0.3)
plt.show()