Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use a machine learning model as the objective function in an optimization problem?

I have a data set for which I use Sklearn Decision Tree regression machine learning package to build a model for prediction purposes. Subsequently, I am trying to utilize scipy.optimize package to solve for the minimized solution based on a given constraint. However, I am not sure if I can take the decision tree model as the objective function for the optimization problem. What should be the approach in a situation like this? I have tried linear regression models such as LarsCV in the past and they worked just fine. But in a linear regression model, you can essentially extract the coefficients and interception point from the model.

like image 511
Arad Haselirad Avatar asked Feb 22 '19 19:02

Arad Haselirad


People also ask

Can we use machine learning for optimization?

A machine learning-based optimization algorithm can run on real-time data streaming from the production facility, providing recommendations to the operators when it identifies a potential for improved production.

What is an objective function in an optimization problem?

Objective Function: The objective function in a mathematical optimization problem is the real-valued function whose value is to be either minimized or maximized over the set of feasible alternatives.

How do you write an objective function for optimization?

Objective function is prominently used to represent and solve the optimization problems of linear programming. The objective function is of the form Z = ax + by, where x, y are the decision variables. The function Z = ax + by is to be maximized or minimized to find the optimal solution.

Which algorithm is used for optimization?

SGD is the most important optimization algorithm in Machine Learning. Mostly, it is used in Logistic Regression and Linear Regression.


1 Answers

Yes; a linear regression model is a straightforward linear function of coefficients (one of which is the "intercept" or "bias").

The problem you have now is that a more complex model isn't quite so simple. You need to load the model into an appropriate engine. To "call" the model, you feed that engine the input vector (the cognate of a list of arguments), and wait for the model to return the prediction.

You need to wrap this process in a function call, perhaps one that issues the model load and processing as external system / shell commands, and returns the results to your main program. Some applications are large enough that it makes sense to implement a full-bore data stream with listener and reporter to handle the throughput.

Does that get you moving?

like image 155
Prune Avatar answered Oct 19 '22 11:10

Prune