【问题标题】:error on decision trees决策树错误
【发布时间】:2016-12-08 11:46:53
【问题描述】:

我有一个包含 377 个 obs 和 7 个变量的数据集。 (我假设它不是很大的数据集)当我尝试使用 Party 包生成决策树时。我收到以下错误:

   Error: cannot allocate vector of size 2.8 Gb
    In addition: Warning messages:
    1: In matrix(0, nrow = p * q, ncol = p * q) :
    Reached total allocation of 8107Mb: see help(memory.size)
    2: In matrix(0, nrow = p * q, ncol = p * q) :
    Reached total allocation of 8107Mb: see help(memory.size)
    3: In matrix(0, nrow = p * q, ncol = p * q) :
    Reached total allocation of 8107Mb: see help(memory.size)
    4: In matrix(0, nrow = p * q, ncol = p * q) :
    Reached total allocation of 8107Mb: see help(memory.size).

我的笔记本电脑有 8GB 内存,但我不明白为什么我不断收到这些错误消息。

【问题讨论】:

  • 当您有很多级别的分类变量时,可能会出现此类内存问题,而ctree() 必须彻底搜索所有拆分为两组。也许您可以发布有关您使用的数据(甚至整个数据)的更多详细信息以及所使用的ctree() 调用?

标签: r decision-tree party


【解决方案1】:

因为你的内存快用完了。 R 将使内存限制默认为操作系统所说的可用。我认为您可以将内存分配设置得更高,而它只会使用虚拟内存(磁盘)吗?但我不确定,最好的办法是获得更多 RAM。

我今天在我的 8GB 笔记本电脑上遇到了这个问题,所以我等到回家后在我的 32GB 台式机上运行它,没有问题。

【讨论】:

    猜你喜欢
    • 2017-05-03
    • 2015-04-07
    • 2012-03-28
    • 2018-05-03
    • 2016-09-29
    • 2023-03-19
    • 2021-10-30
    • 2018-06-29
    • 2012-08-20
    相关资源
    最近更新 更多