Skip to content

Commit

Permalink
Merge pull request #17 from kaneplusplus/master
Browse files Browse the repository at this point in the history
Use new interface to get CType for big.matrix, for bigmemory package version 4.5.8 onwards.
  • Loading branch information
Aloysius Lim committed Oct 21, 2015
2 parents 31e204d + de7474b commit ae16484
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/grow.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ setMethod("grow", signature(forest="bigcforest"), function(

if (trace >= 2L) message("Tree ", treenum, ": Growing tree.")

xtype <- as.integer(.Call("CGetType", x@address, PACKAGE="bigmemory"))
xtype <- as.integer(bigmemory:::getCType(x))
tree <- .Call("growtreeC", x@address, xtype, a@address, a.out@address,
forest, insamp, inweight, treenum, trace)

Expand Down
2 changes: 1 addition & 1 deletion R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ setMethod("predict", signature(object="bigcforest"), function(
}

ntest <- as.integer(nrow(x))
xtype <- as.integer(.Call("CGetType", x@address, PACKAGE="bigmemory"))
xtype <- as.integer(bigmemory:::getCType(x))
ynclass <- length(levels(forest@y))

# fast fix on the test data
Expand Down
4 changes: 2 additions & 2 deletions R/varimp.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ setMethod("varimp", signature(forest="bigcforest"), function(

nvar <- length(forest@varselect)
ntest <- as.integer(nrow(x));
xtype <- as.integer(.Call("CGetType", x@address, PACKAGE="bigmemory"))
xtype <- as.integer(bigmemory:::getCType(x))

importance <- numeric(nvar)
importance.sq <- numeric(nvar)
Expand Down Expand Up @@ -187,4 +187,4 @@ setMethod("varimp", signature(forest="bigcforest"), function(
return(list(importance=importance, importance.ex=importance.ex,
zscore=zscore, significance=significance))
})


0 comments on commit ae16484

Please sign in to comment.