Does Matlab perform optimization better than python?

92 次查看(过去 30 天)
Hi, I am currently working on econometrics research and replicating all the matlab codes into python so that I can expand my research using machine learning stuff. But I found that matlab fminsearch() function works so much better than python's optimization packages such as scipy fmin or minimize. I compared two in the same setting (initial value, iteration, opt algorithm - ‘Nelder-Mead’, etc.), and while matlab's fminsearch successfully found the minimum point, scipy couldn't even though I increased the iteration and also implemented other algorithms.
Does this happen in general? Is matlab better than python when it comes to optimization?
  2 个评论
Torsten
Torsten 2024-2-1
Shouldn't it be an indication that MATLAB is a commercial product while python isn't ?
the cyclist
the cyclist 2024-2-1
While I am obviously a huge fan of MATLAB, I don't think you can infer that it is better simply because it is commercial. As a counterexample to that idea, I would point to R, which many many folks would say is vastly superior to either SAS or SPSS.

请先登录,再进行评论。

回答(1 个)

the cyclist
the cyclist 2024-2-1
Disclaimer: I barely qualify as a Python programmer.
I don't know of any benchmarking specifcally in optimization problems. I've seen a few comparisons among languages through the years (e.g. this one),
I think one challenge with a language like Python is being absolutely certain that you are using the most rigorous and well-tested packages available. It is not always the easiest one to find via google. Obviously scipy is a fantastic all-purpose package, but that doesn't make it the best for optimization problems.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by