2 outputs in Keras model but only one with missing value?

Viewed 61

I'd like to model two variables simultaneously using the same features at the input layer (a feed-forward network), but there are missing values in one of them. I'm wondering if there is a way to mask the missing values when computing loss functions in Keras, bacause I don't want to delete Target 1 values at the index of missing Taregt 2 values during preprocessing.

enter image description here

2 Answers

As of now, I found that the best answer can be lumping two outputs into one and add an extra one-hot code to inputs to include whether the output is target 1 or 2. I found it works great for my study.

enter image description here

Related