Reputation: 13
I built a model in Rstudio, published in Azure ML Studio a web service using "AzureML" R package. When testing the web service on Azure ML Studio, I encountered an error:
Error: AzureML returns error code:
HTTP status code : 400
AzureML error code : LibraryExecutionError
Module execution encountered an internal library error.
The following error occurred during evaluation of R script: R_tryEval: return error: Error: bad restore file magic number (file may be corrupted) -- no data loaded
Do you have any insights on how to solve such issue? Am I missing some important code in the R script?
The model I used was a RandomForest to predicted Species on Iris dataset
# Iris dataset
df = iris
set.seed(100);
index = createDataPartition(df$Species, p = 0.7, list = FALSE)
ML.train = df[index,];
ML.test = df[-index,]; rm(index)
library(randomForest)
model = randomForest::randomForest(Species ~., data = ML.train)
mypredict = function(newdata) {
require(randomForest)
predict(model, newdata, type = "response")
}
# Create workspace
wsObj = AzureML::workspace(id = "my Id", auth = "my token") # I omitted on purpose my Id and my token values
# Publishing
library(devtools)
library(AzureML)
api = AzureML::publishWebService(ws = wsObj,
fun = mypredict,
name = "IrisWebService",
inputSchema = ML.test %>% select(-Species) )
Upvotes: 1
Views: 61
Reputation: 2754
AzureML for RStudio is now not supported as the package is removed from CRAN repository from 2019-07-29. Azure ML studio with this package will not work as the package(AzureML) is removed.
Azure Machine Learning SDK for R can be Downloaded from CRAN at https://cloud.r-project.org/web/packages/azuremlsdk/index.html
Upvotes: 0