简体   繁体   English

我可以使用机器学习模型作为优化问题的目标函数吗?

[英]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.我有一个数据集,我使用 Sklearn 决策树回归机器学习包来构建用于预测的模型。 Subsequently, I am trying to utilize scipy.optimize package to solve for the minimized solution based on a given constraint.随后,我试图利用 scipy.optimize 包来解决基于给定约束的最小化解决方案。 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.我过去曾尝试过线性回归模型,例如 LarsCV,它们工作得很好。 But in a linear regression model, you can essentially extract the coefficients and interception point from the model.但是在线性回归模型中,您基本上可以从模型中提取系数和截点。

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.您需要将此过程包装在一个函数调用中,可能是一个将模型加载和处理作为外部系统/shell 命令发出的函数,并将结果返回到您的主程序。 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?这能让你动起来吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用机器学习解决时间序列问题 - How can I use machine learning for time series problem 我可以在 Gekko 的设计优化过程中使用隐式目标 function。 这个隐式 function 是一个子程序,它创建数字 model - Can I use implicit objective function in a design optimization process in Gekko. this implicit function is a subroutine that creates numerical model 在留一法交叉验证中,我如何使用 `shap.Explainer()` 函数来解释机器学习模型? - In Leave One Out Cross Validation, How can I Use `shap.Explainer()` Function to Explain a Machine Learning Model? 如何稳定机器学习 model? - How can I stabilize a machine learning model? 我可以在 KNN 机器学习模型中使用字符串值作为我的因变量吗? - Can I use string values as my dependent variable in KNN machine learning model? 如何在机器学习 model 中使用 test_proportion 数据? - How can I use the test_proportion data in a machine learning model? 在“二选一”比较中应该使用哪种机器学习模型 - Which machine learning model should I use on “better of two” comparisons 我可以告诉机器学习模型因变量是正态分布的吗? - Can I tell a machine learning model that the dependent variable is normally distributed? 我如何保存需要更少 memory 的机器学习 model - How can i save a machine learning model that takes less memory 如何使用具有任意顺序的 function 的优化、插值、目标? - How do I use Optimization, interpolation, objective with a function of arbitrary order?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM