I am trying to create a random forest regression model and use its output as a custom factor. Right now I can do it in a hacky way in a notebook (see attached notebook) but I imagine there's a better way of doing it. And I'm not sure how to do that in an algorithm.
Any help?