A Generalized Weighted Loss for SVC and MLP