如何根据历史值预测内存使用情况和时间 [英] How can I predict memory usage and time based on historical values

查看:97
本文介绍了如何根据历史值预测内存使用情况和时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的认为数学问题... 我有一些电子表格输出的历史数据以及行数和列数.

A maths problem really I think... I have some historical data for some spreadsheet outputs along with the number of rows and columns.

我要做的是使用这些数据基于已知的行和列来预测峰值内存使用情况和所花费的时间.

What I'd like to do is use this data to predict the peak memory usage and time taken based on the - known - row and columns.

因此,如果不存在历史数据,那么将没有任何预测. 1或2个历史值将非常不准确,但我希望给定足够广泛的历史值,然后可以做出合理准确的预测?

So, if no historical data exists then there will be no predictions. 1 or 2 historical values will be very inaccurate but I hope that given a wide enough variety of historical values, then a reasonably-accurate prediction could be made?

我在jsfiddle上有一张桌子.任何帮助或想法将不胜感激.我真的不知道从哪里开始.

I've got a table on a jsfiddle. Any help or ideas would be really appreciated. I don't really know where to start on this one.

http://jsfiddle.net/JelbyJohn/kwje9chf/3/

<table class="table table-condensed">
</table>

推荐答案

您可以使用线性回归模型.

由于这是一个编程站点,所以下面是一些 R 代码:

Since this is a programming site, here is some R code:

> d <- read.table("data.tsv", sep="\t", header=T)
> summary(lm(log(Bytes.RAM) ~ log(Rows) + log(Columns), d))

Call:
lm(formula = log(Bytes.RAM) ~ log(Rows) + log(Columns), data = d)

Residuals:
    Min      1Q  Median      3Q     Max 
-0.4800 -0.2409 -0.1618  0.1729  0.6827 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  12.42118    0.61820  20.093 8.72e-09 ***
log(Rows)     0.51032    0.09083   5.618 0.000327 ***
log(Columns)  0.58200    0.07821   7.441 3.93e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 0.4052 on 9 degrees of freedom
Multiple R-squared: 0.9062, Adjusted R-squared: 0.8853 
F-statistic: 43.47 on 2 and 9 DF,  p-value: 2.372e-05 

此模型很好地解释了数据(为0.89)并建议以下关系在电子表格的大小和内存使用量之间:

This model explains the data pretty well (the R² is 0.89) and suggests the following relationship between the size of the spreadsheet and memory usage:

Bytes.RAM = exp(12.42 + 0.51 * log(Rows) + 0.58 * log(Columns))

可以使用类似的模型来预测执行时间(Seconds列).在那里,R²是0.998.

A similar model can be used to predict the execution time (the Seconds column). There, the R² is 0.998.

这篇关于如何根据历史值预测内存使用情况和时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆