Fragmented Thought

Azure Machine Learning (ML) error: argument 'env' is missing, with no default

By

Published:

Lance Gliser

Heads up! This content is more than six months old. Take some time to verify everything still works as expected.

Starting into machine learning today using Azure's video tutorials. They are a good start, but the documentation is a bit old. A few of the pieces are now renamed or replaced but generally show up well in search even if 'deprecated.'

One huge stopping point I ran into was in the deployment of web services via steps 4 and 5 of their videos. Everything 'looks' like it works fine, until you reach the testing interface. If you've followed their steps you'll come across this error:

Execute R Script Piped (RPackage) :
The following error occurred during evaluation of R script: R_tryEval: return error:
Error in exists (name, envir = env, mode = mode) : argument "env" is missing, with no default

The cause of that little guy is actually a context based bug within the R language itself. Details are on GitHub.

Remember that bit of R language they had you drop in to generate visual histographs and density plots. Those plots that aren't actually used in the webservice you're deploying? Yeah, they are the cause.

You could just remove them, they do little for you, and do take execution overhead. But you do not want to simply delete the R block from your experiment. At some point you may need R code in that spot, and the of your experiment is setup to use the R specialized names you created. Not worth the effort.

I would suggest commenting them out for performance, but you could also just include the bug fix in your graphing code:

foo = qplot(x=sex, data=dataset1, geom="histogram", fill=income, position="dodge"<strong>, environment = environment()</strong>); print(foo)

That's it, happy experimenting!