specificity it may be defined as how many of the negatives do the model return it is exactly opposite to recall following is the formula for calculating the specificity of the modelspecificity tn tn fp class imbalance problem class imbalance is the scenario where the number of observations belonging to one class is significantly lower than those belonging to the other classes for examplethis problem is prominent in the scenario where we need to identify the rare diseasesfraudulent transactions in bank etc example of imbalanced classes let us consider an example of fraud detection data set to understand the concept of imbalanced classtotal observations fraudulent observations non-fraudulent observations event rate solution balancing the classesacts as solution to imbalanced classes the main objective of balancing the classes is to either increase the frequency of the minority class or decrease the frequency of the majority class following are the approaches to solve the issue of imbalances classesre-sampling re-sampling is series of methods used to reconstruct the sample data sets both training sets and testing sets re-sampling is done to improve the accuracy of model following are some re-sampling techniquesrandom under-samplingthis technique aims to balance class distribution by randomly eliminating majority class examples this is done until the majority and minority class instances are balanced out total observations fraudulent observations non-fraudulent observations event rate