无法在GLM模型中的R中确定最终调整参数

时间:2018-09-25 10:42:45

标签: r azure glm cran

目前,我正在努力在Azure机器学习内部构建模型。据您所知,它使用CRAN R 3.1.0。这段代码在使用CRAN R 3.5.1的本地PC上的R中就像一个超级魅力,但是在Azure ML中我遇到了什么问题

  

无法确定最终调整参数

data <- maml.mapInputPort(1) # class: data.frame
data$time <- as.POSIXct(as.numeric(as.POSIXct(data$time, format = timeformat, tz= "UTC", origin = "1970-01-01"), tz = "UTC"), tz = "UTC", origin = "1970-01-01")
library(caret, verbose=TRUE)
library(foreach)
library(plyr)
sku <- aggregate(data.frame(count = data$ID2), list(value = data$ID2), length)
sku.length <- nrow(sku)

t1 <- trainControl(method = "cv", number = 10, repeats = 3)

 y <- data$value[data$ID2==sku$value[1], drop = FALSE]
 x <- data[data$ID2==sku$value[1], c("year", "month", "weekofyear", "FreqCos1", "FreqSin1", "FreqCos2", "FreqSin2", "FreqCos3", "FreqSin3", "FreqCos4", "FreqSin4", "Salary", "PPCY", "PPCM", "goldP", "kursUSD",
                                     "is_holiday", "collectionYear", "GoodsPrice", "Promo_cnt", "lag1", "lag2", "lag3", "lag4", "lag5", "lag6", "lag7", "lag8", "lag9", "lag10"),drop = FALSE]
 lt1 <- train.default(x,y, 
              method="glm",
              family=poisson,
              preProcess = NULL,
              metric = ifelse(is.factor(y), "Accuracy", "RMSE"),
              maximize = ifelse(ifelse(is.factor(y), "Accuracy", "RMSE") %in% c("RMSE", "logLoss", "MAE"), FALSE, TRUE),
              trControl = t1,
              tuneGrid = expand.grid(.parameter=c(0.001, 0.01, 0.1, 1,10,100, 1000)),
              tuneLength = 100)

pt1 <- predict(lt1)

0 个答案:

没有答案