如何使用Excel中包含的先前数据预测Python中的变量?

发布于 2025-02-10 16:09:11 字数 1228 浏览 0 评论 0原文

我有一种在Python执行的特定算法。 该算法使用3个变量:xyz。 这些变量会影响执行算法所需的时间。 我使用Python将数据写入Excel工作表(使用OpenPyXL) 这是一个外观的示例:

xyz时间秒为秒
1200150001500800
900 900200001800900
13002000018001100

我想在python上打印,在执行前执行算法所需的估计时间用户知道他必须等待多长时间。

编辑以进行澄清:我想预测给定X,Y和Z的所需时间。

我该怎么做? 我可以在Excel中进行,并在Python中阅读价值吗? 还是有办法在python中做到这一点?

我正在寻找一种简单而紧凑的解决方案,可提供不错的结果,而不是一个复杂的解决方案,可提供非常准确的结果。

编辑:我是不是寻找书面并准备实现解决方案。方法的名称或仅仅是开始搜索的地方会很好,因为我以前从未做过。

I have a specific algorithm I execute in Python.
This algorithm uses 3 variables: x, y and z.
These variables affect the time needed to execute the algorithm.
I used Python to write the data to an excel worksheet (using openpyxl)
This is an example of how it looks like:

xyztime in seconds
1200150001500800
900200001800900
13002000018001100

I would like to print, in Python, the estimated time needed to execute the algorithm before execution, so the user knows how long he has to wait.

Edit for clarification: I would like to predict the needed time from a given x, y and z.

How can I do this?
Can I do it in excel, and read the value in Python?
Or is there a way to do it in Python?

I am looking for a simple and compact solution that delivers decent results, rather than a complicated solution that delivers very accurate results.

Edit: I am not looking for a written and ready to implement solution. A name of a method or just a place to start searching would be nice as I have never done this before.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坏尐絯 2025-02-17 16:09:11

在您发布的特定表上,

t = 0.5 * x + 0.105 * y -0.9167 * z

但是每个CPU都有不同的速度,因此每个用户的时间都不同,您将需要在用户的计算机上运行基准标准。

您似乎已经运行了3个基准。如果您有更多,那么您将拥有比未知数更多的方程

On the specific table you posted,

t = 0.5 * x + 0.105 * y -0.9167 * z

But each CPU has different speeds, so the time would be different for each user, and you will need to run a benchmark on the user's computer.

You appear to have run 3 benchmarks. If you have more, then you will have more equations than unknowns, so you would need to do a multivariate linear regression to get a relationship between x,y,z and time

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文