I'm developing the Java application for text document clustering, and I'm researching some evaluation methods. I implemented F-measure (F1 score - Wikipedia, the free encyclopedia), but I have a problem -for some cluster/category the returned value is NaN. It happens where a cluster doesn't contain any data from a specific category - precision and recall are then equal to zero. How should I handle this situation - F-measure in that case should be zero as well? I will be very grateful for any advice.