How to create a custom loss function from sklearn metrics in Keras? I'd like to use the mutual information metric from sklearn as a loss function for a neural network in Keras, but I'm not sure how to do it. I'd like to try this because relationships in my dataset are non-linear and I believe it would help to use this metric instead.

Posts about creating custom loss function are more than a year old so I was hoping there was maybe some easier way to do this as some of it goes above my head.

Any idea about how to go about this?

Thanks a lot
Use the cross-entropy loss function.  That is already built into Keras, and while you haven't defined exactly what you mean by "mutual information metric", if it's what I suspect you mean, it is equivalent to the cross-entropy loss.