Skip to main content
QUICK REVIEW

[论文解读] GuessCompx: An empirical complexity estimation in R.

Marc Agenis-Nevers, Neeraj Dhanraj Bokde|arXiv (Cornell University)|Nov 4, 2019
Data Analysis with R被引用 4
一句话总结

GuessCompx 是一个 R 包,通过在不断增加的数据规模上测试并使用 LOO-MSE 将结果拟合到七个标准复杂度模型(例如 O(N)、O(N²))来经验性地估计算法或函数的时间和内存复杂度。它预测完整数据集的性能,并返回显著性检验和图表,使用户无需访问目标函数的源代码即可进行复杂度分析。

ABSTRACT

This article introduces GuessCompx which is an R package that performs an empirical estimation on the time and memory complexities of an algorithm or a function. It tests multiple increasing-sizes samples of the user's data and attempts to fit one of seven complexity functions: O(N), O(N^2), O(log(N)), etc. Based on a best fit procedure using LOO-MSE (leave one out-mean squared error), it also predicts the full computation time and memory usage on the whole dataset. Conceptually, it relies on the base R functions system.time and memory.size, the latter being only suitable for Windows users. Together with this results, a plot and a significance test are returned. Complexity is assessed with regard to the user's actual dataset through its size (and no other parameter). This article provides several examples demonstrating several cases (e.g., distance function, time series and custom function) and optimal parameters tuning. The subject of the empirical computational complexity has been relatively little studied in computer sciences, and such a package provides a reliable, convenient and simple procedure for estimation process. Further, the package does not require to have the code of the target function.

研究动机与目标

  • 解决计算机科学中经验性计算复杂度估计这一研究不足的领域。
  • 提供一种可靠且用户友好的方法,用于在无需访问目标函数源代码的情况下估计时间和内存复杂度。
  • 使研究人员和实践者能够基于经验性能分析预测完整数据集的执行时间与内存使用情况。
  • 支持在各种应用场景中的复杂度分析,例如距离函数、时间序列和自定义函数。
  • 提供一种使用标准 R 函数和统计拟合的简单、自动化的复杂度估计流程。

提出的方法

  • 使用基础 R 函数 system.time 和 memory.size(仅限 Windows)经验性地测量执行时间和内存使用量。
  • 在用户数据集的多个不断增加规模的样本上执行目标函数。
  • 使用 LOO-MSE(留一法均方误差)将观测到的性能数据拟合到七个候选复杂度模型(例如 O(N)、O(N²)、O(log N))。
  • 基于所有候选模型中最小的 LOO-MSE 选择最佳拟合的复杂度模型。
  • 生成显著性检验和可视化图表,以评估模型拟合效果和复杂度趋势。
  • 基于最佳拟合模型预测完整数据集的执行时间和内存使用量。

实验结果

研究问题

  • RQ1当在不断增加的数据规模上执行时,给定函数的经验时间复杂度是什么?
  • RQ2函数的经验内存复杂度是什么,它如何随输入规模变化?
  • RQ3在七个标准复杂度模型(例如 O(N)、O(N²))中,哪一个最符合观测到的性能行为?
  • RQ4是否能基于小规模测量可靠地预测完整数据集的执行时间和内存使用量?
  • RQ5基于 LOO-MSE 的模型选择在识别真实算法复杂度方面具有多高的鲁棒性和准确性?

主要发现

  • GuessCompx 成功地在各种测试用例中使用 LOO-MSE 识别出最佳拟合的复杂度模型(例如 O(N)、O(N²))。
  • 该包能够基于经验性能分析预测完整数据集的执行时间和内存使用量。
  • 该方法提供显著性检验,以评估拟合复杂度模型的可靠性。
  • 该方法无需访问目标函数的源代码即可运行,显著提升了可用性。
  • 该包支持在各种领域中的实际应用,包括距离计算、时间序列分析和自定义函数。
  • 实证结果表明,该方法仅通过在不断增加的数据规模上测量运行时间和内存使用量,即可可靠地估计复杂度。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。