[R-SIG-Mac] MacBook memory error: Error in array(0, c(n, p)) : 'dim' specifies too large an array
Simon Urbanek
simon.urbanek at r-project.org
Wed Dec 19 01:27:00 CET 2012
Mike,
first, as the error tells you, your "y" is not what svm.fs() requires, i.e. it has to be a vector of -1 and 1, so in your code that would be
y <- sample(c(-1,1), 20, replace=TRUE)
Then further penalizedSVM is seriously buggy - the author fails to use match.arg() on the arguments, so what happens is that all the defaults are invalid and break. The consequence is that the user has to specify all defaults explicitly, otherwise the code doesn't work (interestingly the author specifies everything in the examples - otherwise it would not pass checks at all). For example this seem to sort of work (still with some warnings):
model <- svm.fs(x,y,"scad","interval",inner.val.method="cv",parms.coding="none",show="final")
Given those trivial mistakes in the code and the fact that it uses print() all over the place which is plain wrong, I'd be very careful with relying on the penalizedSVM package, so use at your own risk.
Finally, this is not a Mac question, please consider using R-help for such queries. (And, no, it has nothing to do with memory usage).
Cheers,
Simon
On Dec 18, 2012, at 6:48 PM, C W wrote:
> Dear list,
> I am trying to run svm.fs() in package penalizedSVM,
>
> x <- matrix(rnorm(100), 20, 5)
>
> y <- sample(c(0,10), 20, replace=TRUE)
>
> model <- svm.fs(x,y)
>
> And I get the following warnings and errors.
>
> rror in array(0, c(n, p)) : 'dim' specifies too large an array
>
> In addition: There were 16 warnings (use warnings() to see them)
>
> There were 50 or more warnings (use warnings() to see the first 50)
>
>> warnings()
>
> Warning messages:
>
> 1: In if (fs.method == "1norm" & inner.val.method == "gacv") stop("gacv is
> not availible for 1norm SVM. Use k fold cv instead.") :
>
> the condition has length > 1 and only the first element will be used
>
> 2: In if (grid.search == "interval") { ... :
>
> the condition has length > 1 and only the first element will be used
>
> 3: In if ((fs.method %in% c("scad", "1norm")) & is.null(bounds)) { ... :
>
> the condition has length > 1 and only the first element will be used
>
> 4: In if (fs.method %in% c("DrHSVM") & is.null(bounds)) { ... :
>
>
> I am guessing this is because of the limit memory?
>
> Mike
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>
More information about the R-SIG-Mac
mailing list