【发布时间】:2019-11-07 06:34:47
【问题描述】:
尝试训练 NeuralNet,但我无法标准化我的数据。
为缩放定义 Max 和 Mins 可以正常工作。
maxs <- apply(tour_weahter_data, 2, max)
mins <- apply(tour_weahter_data, 2, min)
这是我要扩展的数据:
head(tour_weahter_data)
Start Time Starting Station ID Duration Distance Temperatur Humidity
1 2016-07-07 13:00:00 3063 12 578.7915 18 72
2 2016-07-07 13:00:00 3040 10 1262.4654 18 72
3 2016-07-07 13:00:00 3063 19 1660.0441 18 72
4 2016-07-07 13:00:00 3018 10 907.1427 18 72
5 2016-07-07 13:00:00 3076 10 1004.5161 18 72
6 2016-07-07 13:00:00 3034 4 448.0982 18 72
这是对函数的调用:
scaled <- as.data.frame(scale(tour_weahter_data, center = mins, scale = maxs - mins))
这是我收到的错误消息:
FUN(x, aperm(array(STATS, dims[perm]), order(perm)), ...) 中的错误: 二元运算符的非数字参数
另外:警告信息:
在 scale.default(tour_weahter_data, center = mins, scale = maxs - : 强制引入的 NAs
我的数据有问题还是我使用的功能不正确?
【问题讨论】:
标签: r dataframe normalization