我正在处理一个大型数据集(41,000个观测数据和22个预测变量),并试图使用以下代码来拟合随机森林模型:
模型<- randomForest(as.factor(data$usvsa) )~、ntree=1000、importance=TRUE、+ proximity=TRUE、data=data)。
我遇到以下错误:
Error: cannot allocate vector of size 12.7 Gb
In addition: Warning messages:
1: In matrix(0, n, n) :
Reached total allocation of 6
使用以下Groovy代码片段,我得到了一些意想不到的基准测试结果:
class A{
def n(){
return 1
}
}
class B{
def n(){
return 2
}
}
class C{
def n(){
return 3
}
}
class D{
def n(){
return 4
}
}
def bench(loops){
def a = new A()
def b = new B()
def c = new C()