工程师和研究人员需要在成本、重量和性能等相互冲突的目标之间找到最优权衡。本技能通过 pymoo 提供 NSGA-II、NSGA-III 和其他进化算法的访问,为复杂设计问题发现帕累托最优解。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「pymoo」。 Optimize the ZDT1 problem with NSGA-II
預期結果:
- Running NSGA-II on ZDT1 bi-objective benchmark
- Population size: 100, Generations: 200
- Found 85 Pareto-optimal solutions
- Best f1 range: 0.001 - 0.999
- Best f2 range: 0.035 - 1.002
正在使用「pymoo」。 Minimize the Sphere function with 10 variables
預期結果:
- Using Genetic Algorithm with population size 100
- Running 100 generations
- Best objective value: 0.000123
- Converged solution near global optimum at origin
正在使用「pymoo」。 Solve a constrained optimization problem
預期結果:
- Problem with 2 inequality constraints
- Applied feasibility-first constraint handling
- 95 out of 100 final solutions are feasible
- Best feasible solution satisfies all constraints
安全審計
安全This skill is a pure mathematical optimization framework using the pymoo library. All static findings are FALSE POSITIVES caused by the scanner misinterpreting markdown code fences as shell commands, and algorithm names as security keywords. The skill contains only Python documentation and example scripts that perform local mathematical computations with no file system access, network calls, or external command execution beyond standard Python imports.
風險因素
⚙️ 外部命令 (264)
🌐 網路存取 (2)
品質評分
你能建構什麼
工程设计权衡
为结构组件和机械零件在成本、重量、强度和性能之间找到最优平衡。
超参数优化
在准确率、推理时间和内存使用等多个指标上优化机器学习模型参数。
资源分配问题
解决具有时间、成本和质量等冲突目标的调度和资源分配问题。
試試這些提示
Use pymoo to optimize the Sphere function with 10 variables using Genetic Algorithm. Set population size to 100 and run for 100 generations.
Solve the ZDT1 bi-objective benchmark problem using NSGA-II in pymoo. Show the obtained Pareto front compared to the true Pareto front.
Create a custom pymoo problem that minimizes f1 = x1^2 + x2^2 and f2 = (x1-1)^2 + (x2-1)^2 with bounds 0 <= x1, x2 <= 5. Solve with NSGA-II.
After obtaining a Pareto front from a multi-objective optimization, use Pseudo-Weights to select a solution with 30% weight on objective 1 and 70% weight on objective 2. Show the selected solution and its decision variables.
最佳實務
- 设置随机种子(seed=1)以实现可重现的优化运行
- 在应用决策方法之前将目标归一化到 [0,1]
- 对于 2-3 个目标选择 NSGA-II,对于 4 个以上目标选择 NSGA-III
- 从较小的种群开始,如果结果缺乏多样性则增加种群大小
避免
- 对多目标问题(4 个以上目标)使用 NSGA-II 会导致多样性差
- 跳过约束公式化为 g(x) <= 0 会导致不可行解
- 在没有终止条件的情况下运行优化会浪费计算资源
- 忽略结果可视化会错过有关解质量的洞察