Update metrics to use Enum
🚀 Feature

Motivation

Update metrics package to use Enum where it makes sense. For example:

  
    
      pytorch-lightning/pytorch_lightning/metrics/classification/helpers.py
    
    
        Lines 79 to 87
      in
      f782230
    
  
  
    

        
          
           # Get the case 
        

        
          
           if preds.ndim == 1 and preds_float: 
        

        
          
               case = "binary" 
        

        
          
           elif preds.ndim == 1 and not preds_float: 
        

        
          
               case = "multi-class" 
        

        
          
           elif preds.ndim > 1 and preds_float: 
        

        
          
               case = "multi-label" 
        

        
          
           else: 
        

        
          
               case = "multi-dim multi-class" 
        
    
  


the case (data type) could be made an enum type
class DataType(LightningEnum):
    BINARY = 'binary'
    MULTILABEL = 'multi-label'
    MULTICLASS = 'multi-class'
    MDMC = 'multi-dim multi-class'
Pitch

Alternatives

Additional context

@Borda