BYU-PRISM / GEKKO

GEKKO Python for Machine Learning and Dynamic Optimization
https://machinelearning.byu.edu
Other
573 stars 102 forks source link

Using sklearn methods inside Gekko equation #128

Closed pavankumarg1729 closed 2 years ago

pavankumarg1729 commented 2 years ago

I am working on an optimization problem using Gekko and i need to pass in the prediction from a pre built model using Sklearn. I am not able to use predict.proba method using Gekko problem statement. Is there any way to solve this problem?

APMonitor commented 2 years ago

You can pass in a "Measured" value to Gekko with x.value=15.0 to update the value. There is no way to import equations from sklearn into gekko right now because Gekko solvers need the equations in Gekko format for automatic differentiation. Gekko doesn't allow black box models at this time. If you need an optimizer for black box models, try scipy.optimize.minimize().