2

This is my first time posting so I apologize if I don't have all my crap together.

I am fairly new to Azure ML and R, but I am trying to implement a Logit model through R in Azure since it doesn't seem to be one of the Microsoft-provided models in Azure ML.

When I run my model and other code in RStudio, I don't get any errors, but when I try to implement it through a "Create R Module" in Azure, I get an error message saying:

"Error 0063: The following error occurred during evaluation of R script: ---------- Start of error message from R ---------- cannot coerce class ""function"" to a data.frame ----------- End of error message from R -----------"

There seems to be very little Azure ML documentation that covers R model creation out there, so I thought I would turn here for some potential answers. It is likely that I am just missing something.

Here is the code I have been running:

Blockquote Trainer Script

model<-glm(Mat_Bin~Mat.Mkt.Pen+debt+Urban.Vmi+GDP.Per.Capita+Avg.Low+MSAcrash, data=data, family=binomial)

Scorer R Script

scores<-as.data.frame(predict(model, subset(data, select=c(predict.MatModel3.))))

names(scores)<-c("Predicted Values")

I tried to upload pictures of everything, but apparently I need higher reputation to do so. But my experiment is super simple. Just some simple column manipulation and then the training and scoring of my model.

Any ideas on why I am getting that error message?

Community
  • 1
  • 1
JBeazer
  • 25
  • 6
  • Could you post the data? Best would be a small subset of the data that produces the same error so we can try it out. – Mike Wise Jun 05 '15 at 23:13
  • I think we'll better be able to help you if you could provide a [minimum reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). In particular, we would need a sample dataset `data` and code that can be applied to `data` that causes the error. – josliber Jun 05 '15 at 23:13
  • In R the token `data` is a function. People are generally advised not to name their data-objects "data" because the error messages get rather confusing. R is suppose to keep a wall between function names and other object names but you may have stumbled across an infelicity of AzureML if in fac there is a "data"-data-object and the evaluation has gone off-road. – IRTFM Jun 05 '15 at 23:15

1 Answers1

0

If it's just a simple naming error on your part, you could try:

model <- glm(Mat_Bin ~ Mat.Mkt.Pen + debt + Urban.Vmi+ GDP.Per.Capita + Avg.Low+MSAcrash, 
             data=scores, family=binomial)
IRTFM
  • 258,963
  • 21
  • 364
  • 487