none
Output as dataframe (Internal Server error: 500) RRS feed

  • Question

  • Hi 

    We are currently evaluating ML Server. I have setup a Azure VM with ML Server and configured it with One-Box.

    I created a simple function that accepts 2 dataframe inputs and will return as dataframe as well.

    GetSkillLevel <- function(aggreateddata,numberofclasses=2,encodingtable,firstusenumber,lastusenumber,frequencynumber,valuenumber)
    {
      aggreateddata$RecencyQuantile=cut(aggreateddata$LastUsedUnixDate, breaks = quantile(aggreateddata$LastUsedUnixDate, probs = seq(0, 1, 1/numberofclasses)), 
                                        include.lowest = TRUE, labels = 1:numberofclasses)
      
      aggreateddata$FirstUseQuantile=cut(aggreateddata$FirstUsedUnixDate, breaks = quantile(aggreateddata$FirstUsedUnixDate, probs = seq(0, 1, 1/numberofclasses)), 
                                         include.lowest = TRUE, labels = 1:numberofclasses)
      
      aggreateddata$FrequencyQuantile=cut(aggreateddata$Frequency, breaks = quantile(aggreateddata$Frequency, probs = seq(0, 1, 1/3)), 
                                          include.lowest = TRUE, labels = 1:3)
      
      aggreateddata$value=cut(aggreateddata$Value, breaks = quantile(aggreateddata$Value, probs = seq(0, 1, 1/numberofclasses)), 
                              include.lowest = TRUE, labels = 1:numberofclasses)
      
      aggreateddata$rfmcode=paste(aggreateddata$RecencyQuantile,aggreateddata$FrequencyQuantile,aggreateddata$value,aggreateddata$FirstUseQuantile,sep = "")
      
      labeleduser=merge(aggreateddata,encodingtable,by.x="rfmcode",by.y="encoderfm")
      
      return(labeleduser)
    }

    Publish the service successfully;

    serviceName <- paste0("MaturityModel", round(as.numeric(Sys.time()), 0))
    
    api <- publishService(
      serviceName,
      code = GetSkillLevel,
      inputs = list(aggreateddata= "data.frame", encodingtable = "data.frame"),
      outputs = list(labeleduser = "data.frame"),
      v = "1.0.0"
    )

    Able to see to service when I run listServices()

    But when trying to consume I got the following error

    api <- getService(name="MaturityModel1559523925", v="1.0.0")
      
    MaturityModel <- api$GetSkillLevel(gislogfromdb, rfmencode)
      
    #Get Skill Level  
    df1 <- MaturityModel$output("labeleduser")

    Can someone enlighten me please.

    Cheers,

    Monday, June 3, 2019 8:38 PM