You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, many thanks for the ranger package! Is there a way to directly use a matrix as a covariate without colnames? In this version of the package I don't see the solution...
I hope the code explains the issue well. x is a given matrix but without colnames ranger does not accept it.
`
x <- matrix(rnorm(30*2), ncol=2); y <- rnorm(30)
ranger(x=x,y=y)
Error in ranger(x = x, y = y) : Error: No covariates found.
colnames(x)
NULL
colnames(x) <- paste0("x",1:2)
ranger(x=x,y=y)
Ranger result
Call:
ranger(x = x, y = y)
Type: Regression
Number of trees: 500
Sample size: 30
Number of independent variables: 2
Mtry: 1
Target node size: 5
Variable importance mode: none
Splitrule: variance
OOB prediction error (MSE): 1.034131
R squared (OOB): -0.4679862
`
The text was updated successfully, but these errors were encountered:
Currently, we are relying on the column names to re-identify the correct features during prediction. In principle, we could accept matrices without colnames and just expect the same feature order for prediction.
Hi, many thanks for the ranger package! Is there a way to directly use a matrix as a covariate without colnames? In this version of the package I don't see the solution...
I hope the code explains the issue well. x is a given matrix but without colnames ranger does not accept it.
`
Call:
ranger(x = x, y = y)
Type: Regression
Number of trees: 500
Sample size: 30
Number of independent variables: 2
Mtry: 1
Target node size: 5
Variable importance mode: none
Splitrule: variance
OOB prediction error (MSE): 1.034131
R squared (OOB): -0.4679862
`
The text was updated successfully, but these errors were encountered: