GA rule discovery fitness function
The confidence equation you are referring to is the definition of precision in the Classification/pattern-recongition/information-retrieval contexts. You can visually understand the equation with the help of the following figure from the wikipedia page:



 P     : Refers to the set of samples in your dataset. (Selected elements)
|P|    : Refers to the number of samples in your dataset.
 D     : Refers to the set of correct class labels.(aka. Ground Truth).
|P &amp; D|: Refers to the number of samples in the dataset that the classifier correctly labeled. 


I hope with this understanding you can implement the fitness function for your Genetic Algorithm. If you want more help in defining the fitness function, then you should probably add details about your approach or links to the research paper you are trying to follow.