Open bchazalet opened 7 years ago
This is what I get if I run it with buildOneTree untouched:
com.opendatagroup.hadrian.errors.PFAInitializationException: JSON datum {"string":1} does not match any type in union [{"type":"record","fields":[{"name":"field","type":{"type":"enum","symbols":["field1", "field2"],"name":"Enum_3"}},{"name":"operator","type":"string"},{"name":"value","type":"double"},{"name":"pass","type":["TreeNode","double"]},{"name":"fail","type":["TreeNode","double"]}],"name":"TreeNode"},"double"]
I had been working on converting a randomForest model from R to PFA without success until I found that
buildOneTree
seems to be harcoded for a leaf string value. My trees are all numerical.If I duplicate the function for the same one returning
list(double = node[[6]])
instead it all seems to work.My final R code looks like this: