> runLearner(l, form, train, test)
错误于single(Status ~ ., list(Status = c(4L, 4L, 4L, 4L, 4L, 4L, 4L, :
参数((list(Status = c(4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), Flow = c(22, 15, 16, 19, 20, 18, 14, 14, 15, 14, 15, 22, 16, 17, 17, 16, 17, 18, 14, 12, 15, 15, 17, 14, 14, 13, 14, 16, 15, 14, 15, 19, 14, 17, 17, 14, 17, 16, 14, 16, 18, 16, 13, 14, 18, 15, 15, 13, 17, 14, 15, 16, 11, 13, 13, 14, 15, 13, 15, 13, 14, 13, 14, 13,
15, 14, 14, 13, 14, 15, 14, 13), Occupancy = c(23.67, 18, 18.33, 21.78, 22.78, 17.89, 15.33, 14.33, 17.89, 16, 20.78, 24.33, 21, 19.56, 21.67, 20.11, 27.78, 36.56, 31.22, 28.33, 30.44, 24.89, 31.67, 39.44, 31.44, 30.89, 31.22, 32.33, 31.33, 32.89, 26.22, 37.56, 30.33, 48.11, 39, 33.11, 41, 33.22, 31.56, 39.44, 32.89, 41.33, 29.78, 30.22, 37.67, 40.89, 31.56, 24.56, 34.44, 35.78, 31.33, 34.56, 27.22, 35.56, 35.44, 30.89, 39.44, 27.33, 39, 35.11, 37.33, 24.44, 26.22, 30.89, 32.78, 27.8
> myrun <- function (l, ...)
+ {
+ if (!inherits(l, "learner"))
+ stop(l, " is not of class \"learner\".")
+ do.call(l@func, c(list(...), l@pars))
+ }
>
> myrun(l ,form, train , test)
prec.congestion prec.free prec.jam prec.smooth
1 NaN NaN NaN
rec.congestion rec.free rec.jam rec.smooth
1 NaN NaN NaN
警告信息:
In nnet.formula(form, train, ...) : groups free jam are empty
数据代入原函数就出错,重写一个函数方法一样就能得到结果
被搞崩溃了,谁能告诉我到底是为什么??
|