Decisify
1.0.0
Decisify 是一个 Python 包,它利用生成式 AI 来解释优化模型做出的决策。
数学优化是运筹学中的重要工具,使企业能够做出数据驱动的决策,从而最大限度地提高效率并最大限度地降低成本。然而,这些模型的复杂性往往使利益相关者难以理解和信任所做出的决策。
Decisify 通过使用生成式 AI 为优化模型生成的决策提供清晰、易于理解的解释来应对这一挑战。通过增强透明度和信任,Decisify 旨在推动不同行业更广泛地采用优化技术。
您可以使用 pip 安装 Decisify:
pip install decisify
以下是如何使用 Decisify 的简单示例:
import decisify
# Your optimization model code here
( 1 ) Just define the Pydantic Models for ( a ) Input ( b ) Output
( 2 ) Concrete implementation of optimization model
( 3 ) A method to read , the solution
现在,您将学会使用 decisify,从现在开始就很简单了
# Generate explanations for the model's decisions
trnsprt_model = TransportationModel ()
solution = trnsprt_model . get_solution ( input_data )
print ( solution . model_dump_json ())
interrogator = GurobiInterrogator ( trnsprt_model , input_data )
answer = interrogator . answer ( "What is the optimal solution for the transportation problem?" )
print ( answer )
answer = interrogator . answer ( "How many factories and how many distribution centers are there?" )
print ( answer )
#Now, lets assume the user wants to change the supply at warehouse W1 to 20
answer = interrogator . what_if ( "the courier company just doubled the transportation costs, how does this affect the total cost?" )
print ( answer )
answer = interrogator . what_if ( "The demand at customer C1 has increased by 100 times, how does this affect the total cost?" )
print ( answer )
我们欢迎为 Decisify 做出贡献!请参阅我们的贡献指南以获取更多信息。
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅许可证文件。
如有任何问题或建议,请通过 [email protected] 联系我们。