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] 與我們聯繫。