用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill run2-pareto-optimization命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
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.
基于 SOC 职业分类
正在显示 SKILL.md
| name | run2_pareto-optimization |
| description | Finding the Pareto frontier for multi-objective optimization using dominance conditions. |
When you need to optimize multiple conflicting objectives (e.g., maximizing F1, minimizing error), you can identify the Pareto frontier by explicitly checking if a point is "dominated" by another point.
Ensure you have numpy and pandas installed:
pip install numpy pandas
import numpy as np
import pandas as pd
def get_pareto_frontier(df, obj_max_cols, obj_min_cols):
"""
Finds non-dominated rows in a DataFrame.
"""
pareto_mask = np.ones(len(df), dtype=bool)
for i in range(len(df)):
# Assume self is not dominated unless proven otherwise
row_i = df.iloc[i]
# Check against all other rows
better_or_equal = np.ones(len(df), dtype=bool)
strictly_better = np.zeros(len(df), dtype=bool)
for col in obj_max_cols:
better_or_equal &= (df[col] >= row_i[col])
strictly_better |= (df[col] > row_i[col])
for col in obj_min_cols:
better_or_equal &= (df[col] <= row_i[col])
strictly_better |= (df[col] < row_i[col])
# If any other point is better or equal in all, AND strictly better in at least one
if np.any(better_or_equal & strictly_better):
pareto_mask[i] = False
return df[pareto_mask]
# pareto_df = get_pareto_frontier(results_df, ['F1'], ['delta'])