Decisify es un paquete de Python que aprovecha la IA generativa para explicar las decisiones tomadas por los modelos de optimización.
La optimización matemática es una herramienta fundamental en la investigación de operaciones, que permite a las empresas tomar decisiones basadas en datos que maximizan la eficiencia y minimizan los costos. Sin embargo, la complejidad de estos modelos a menudo dificulta que las partes interesadas comprendan y confíen en las decisiones que se toman.
Decisify aborda este desafío mediante el uso de IA generativa para proporcionar explicaciones claras y comprensibles para las decisiones producidas por los modelos de optimización. Al mejorar la transparencia y la confianza, Decisify tiene como objetivo impulsar una mayor adopción de técnicas de optimización en diversas industrias.
Puedes instalar Decisify usando pip:
pip install decisify
Aquí hay un ejemplo simple de cómo usar 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
Ahora, has leído cómo usar decisify, es simple a partir de este punto.
# 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 )
¡Agradecemos las contribuciones a Decisify! Consulte nuestras pautas de contribución para obtener más información.
Este proyecto tiene la licencia MIT; consulte el archivo de LICENCIA para obtener más detalles.
Si tiene alguna pregunta o sugerencia, contáctenos en [email protected].