Closed quasipolynomial closed 7 years ago
The application logic fails when attempting to identify column names based on randomForest
data structure:
xcols = rf$xnames
if(is.null(xcols)){
xcols = names(rf$forest$xlevels) # THIS
}
The "matrix view" has been tested when x
and y
arguments are both data.frame
. For example:
https://github.com/jpmml/jpmml-r/blob/master/src/test/R/randomForest.R#L40
https://github.com/jpmml/jpmml-r/blob/master/src/test/R/randomForest.R#L65
Could it be that you're using "raw" matrices instead of data frames in your script? Specifically, what is the data type of your data
variable?
print(class(data))
Amazing. It was precisely that issue.
> print(class(data)) [1] "matrix" > data = as.data.frame(data)
Conversion works fine now.
All the best,
K
Hi there,
I am receiving the following error when trying to convert a randomForest generated using "matrix view." From what I understand, pmml doesn't support this feature. However, I was hoping to shed more light on an "IllegalArgumentException" as such:
Thanks,
K