Hi Keras users,
I was hoping that someone might be able to give me a hand.
I've been using keras to model a disease risk factor in 11 different populations and am trying to create a custom loss function that is aware of these population groups.
Currently training the model with mse as the loss function, but I would
like to encourage the model to condense the variation in its predictions for specific groups. Specifically, the screenshot below shows model performance where each colour represents a different population group.
As an example, the green group is much narrower than the blue and purple group, suggesting that the model has done a better job learning that group. I would like to create a loss function to explicitly encourage the model to condense variation on the x-axis, however, I'm having trouble passing group ids to the loss function back end.
Is anyone able to suggest a workaround? I'd be incredibly grateful for any help that you are kind enough to provide. Please let me know if you have any questions.