我正在尝试组合来自不同机器学习模型的信号来创建单元机器学习模型。我有两个具有不同功能(df1, df2
)的数据集(df1 = x1, x2 & df2 = z1, z2
),它预测相同的输出(y
)。
可重复的例子如下
library(caret)
df1 <-
data.frame(x1 = rnorm(200),
x2 = rnorm(200),
y = as.factor(sample(c("bob", "bill"), 200, replace = T)))
df2 <-
data.frame(z1 = rnorm(400),
z2 = rnorm(400),
y = as.factor(sample(c("bob", "bill"), 400, replace = T)))
library(caret)
check_1 <- train( x = df1[,1:2],y = df1[,3],
method = "nnet",
tuneLength = 10,
trControl = trainControl(method = "cv",
classProbs = TRUE,
savePredictions = T))
check_2 <- train( x = df2[,1:2],y = df2[,3] ,
method = "nnet",
preProcess = c("center", "scale"),
tuneLength = 10,
trControl = trainControl(method = "cv",
classProbs = TRUE,
savePredictions = T))
如何将两种模型合并为一个Meta Machine学习模型?有一个接近的答案here,它集合了模型。但是,我的问题是将不同训练集的输出结合起来并组合成单元机器学习模型。