很少有模型类型允许“多输出”回归/分类。
sklearn文档提供了一个很好的概述:

然而MultiOutputRegressor,每个目标只适合一个回归器。同时与 RegressorChain
每个模型使用提供给模型的所有可用特征加上链中较早模型的预测,按照链指定的顺序进行预测。
Keras 的功能 API允许同时对多个目标进行建模。这种模型的一般结构是(完整的最小示例在这里):
# Input and model architecture
Input_1=Input(shape=(YOUR_SHAPE_HERE, ))
x = LAYERS_HERE
# Outputs
out1 = Dense(1)(x)
out2 = Dense(1)(x)
# Compile/fit the model
model = Model(inputs=Input_1, outputs=[out1,out2])
model.compile(optimizer = "rmsprop", loss = 'mse')
# Add actual data in the fit statement
model.fit(train_data, [train_targets,train_targets2], epochs=500, batch_size=4, verbose=0, validation_split=0.2)