Reputation: 695
Assume I have an Execute R Script that calculates multiple variables, say X and Y. Is it possible to save X as a dataset ds_X and Y as a dataset ds_Y?
The problem is that there is only 1 output port available that needs to be mapped to a data.frame. Am I missing an option to add more output ports? Same problem for input ports. I may connect 2 of the "Enter Data Manually" modules to it, but what if I need 3? The current workaround is to put CSV files in a ZIP file and connect that. Are there easier solution?
Example of what i tried:
I tried adding ds_X and ds_Y to a list. The idea is to pass this list to multiple "Execute R Script" modules and use the required list elements there. Mapping a list to an output port does not seem to work though:
# Calculate lots of stuff - results are ds_X and ds_Y
ds_X <- mtcars
ds_Y <- cars
out <- list(ds_X, ds_Y)
maml.mapOutputPort("out")
results in an error:
Error: Mapped variable must be of class type data.frame at this time.
Upvotes: 0
Views: 794
Reputation: 61
You can author custom R Modules.
Here is some documentation: https://blogs.technet.microsoft.com/machinelearning/2015/04/23/build-your-own-r-modules-in-azure-ml/ https://learn.microsoft.com/en-us/azure/machine-learning/machine-learning-custom-r-modules
Upvotes: 1