Is it possible to do an optimizer in KNIME with ML models as objective function?
What tasks should it solve:
For example, we built an ML model.
Next, we want the model to give us the optimal parameters to maximize objective function.
Here’s an example of how it’s done in Python: a sklearn ML model is taken and put into the optimizer from the SciPy library:
Perhaps there is already something like this, or it can be easily wrap the same Python libraries and use them to make an optimizer, which can be used for knime projects.
This node (parameter optimization) usually used for best hyperparameter search using brute force or random search (like in Python sklearn library: grid search and random search). But when we have nonlinear continuous function like machine learning model (as a function of variables, not hyperparameters) we need more complex algorithm like genetic algorithm, BFGS, Generalized Reduced Gradient, etc
To solve this task in KNIME I would use a parameter optimization loop, with one parameter for each input feature of the model and a defined range. In the loop body I would convert the flow variables into a table, apply the model and use the predicted value as the objective value to maximize. Maybe that leads already to good results with one of the available optimizers (Bayesian Optimization (TPE), hill climbing or grid search (maybe to time consuming))