I am using F1_score metrics in sklearn. For some training data sets, the total number of y=1(rare case) sets is zero, the F1_score is zero,which is normal. But the sklearn gives the following warning:
"UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 due to no predicted samples".
Does anyone know how to silence this warning? and in general could we silence all kinds of warnings in sklearn ?