docstr: [Calculates the metrics for classification problems]
  
  Args:
      y_true ([type]): [True labels from the dataset]
      predicted ([type]): [Predicted values from the model]
  
  Returns:
      Accuracy metric of the model
      Precision value of the model
      Recall value of the model
      False Positive Rate
      False Negative Rate
docstr_tok: ["[","Calculates","the","metrics","for","classification","problems","]","Args",":","y_true","(","[","type","]",")",":","[","True","labels","from","the","dataset","]","predicted","(","[","type","]",")",":","[","Predicted","values","from","the","model","]","Returns",":","Accuracy","metric","of","the","model","Precision","value","of","the","model","Recall","value","of","the","model","False","Positive","Rate","False","Negative","Rate"]
code: def classification_cohort_metrics(self, y_true, predicted):
      """[Calculates the metrics for classification problems]
  
      Args:
          y_true ([type]): [True labels from the dataset]
          predicted ([type]): [Predicted values from the model]
  
      Returns:
          Accuracy metric of the model
          Precision value of the model
          Recall value of the model
          False Positive Rate
          False Negative Rate
      """
      if len(y_true) != 0:
          # Accuracy
          accuracy = round(
              metrics.accuracy_score(y_true, predicted), 2
          )  # Accuracy classification score.
          # Precision
          precision = round(
              metrics.precision_score(
                  y_true, predicted, zero_division=1
              ),
              2,
          )  # Compute the precision
          # Recall
          recall = round(
              metrics.recall_score(y_true, predicted, zero_division=1),
              2,
          )  # Compute the recall
          # False Positive Rate (FPR)
          tn, fp, fn, tp = metrics.confusion_matrix(
              y_true, predicted
          ).ravel()  # Compute confusion matrix to evaluate the accuracy of a classification.
          # False Negative Rate (FNR)
          fpr = round((fp / (fp + tn)), 2)
          fnr = round((fn / (tp + fn) if (tp + fn) else 0), 2)
  
          return accuracy, precision, recall, fpr, fnr
      else:
          pass
  
file_path: explainx/lib/cohort_analysis.py
imports: from imports import *
label_desc: Use image node_id 11 for calling the cohortAnalysis obj's underlying member method code with example usage: obj.classification_cohort_metrics(y_true, predicted) and returns: accuracy,  precision,  recall,  fpr,  fnr