我正在尝试使用kernlab 中的 gausspr函数解决回归问题。输入是标准化的。但是 predict(model, test.set) 的输出结果是一组 NaN 值!
训练集,X
M1 -0.3437191 -0.1755636 -0.1914969 -0.205308 -0.1595554
M2 -0.3437191 -0.1755636 -0.1914969 -0.205308 -0.1595554
M3 -0.3437191 -0.1755636 -0.1914969 -0.205308 -0.1595554
M4 -0.3437191 -0.1755636 -0.1914969 -0.205308 -0.1595554
M5 -0.3437191 -0.1755636 -0.1914969 -0.205308 -0.1595554
训练输出,Y 是
Y = c(1,2,3,4,5)
测试集,Z
T1 1.5530507 -0.2152377 -0.202634 -0.1460405 -0.1592964
T2 1.5530507 -0.2152377 -0.202634 -0.1460405 -0.1592964
T3 -0.3736244 -0.2152377 -0.202634 -0.1460405 -0.1592964
T4 -0.3736244 -0.2152377 -0.202634 -0.1460405 -0.1592964
T5 -0.3736244 -0.2152377 -0.202634 -0.1460405 -0.1592964
编码:
library(kernlab)
model <- gausspr(X,Y)
predict(model, Z)
输出是
> head(res14)
[,1]
[1,] NaN
[2,] NaN
[3,] NaN
[4,] NaN
[5,] NaN
[6,] NaN
我想知道为什么我会得到这个输出。