class_docstr: Curve class.
  
  >>> import numpy as np
  >>> crv = Curve(actual_vector=np.array([1, 1, 2, 2]), probs=np.array([[0.1, 0.9], [0.4, 0.6], [0.35, 0.65], [0.8, 0.2]]), classes=[2, 1])
  >>> crv.classes
  [2, 1]
  >>> crv.thresholds
  [0.1, 0.2, 0.35, 0.4, 0.6, 0.65, 0.8, 0.9]
  >>> crv.data[2]["TPR"]
  [1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 0.5, 0.0]
  >>> crv.data[2]["FPR"]
  [1.0, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0]
  >>> auc_trp = crv.area()
  >>> auc_trp[1]
  0.75
  >>> auc_trp[2]
  0.75
  >>> auc_mid = crv.area(method="midpoint")
  >>> auc_mid[1]
  0.75
  >>> auc_mid[2]
  0.75
class_docstr_tok: ["Curve","class",".",">",">",">","import","numpy","as","np",">",">",">","crv","=","Curve","(","actual_vector=np.array","(","[","1",",","1",",","2",",","2","]",")",",","probs=np.array","(","[","[","0.1",",","0.9","]",",","[","0.4",",","0.6","]",",","[","0.35",",","0.65","]",",","[","0.8",",","0.2","]","]",")",",","classes=","[","2",",","1","]",")",">",">",">","crv.classes","[","2",",","1","]",">",">",">","crv.thresholds","[","0.1",",","0.2",",","0.35",",","0.4",",","0.6",",","0.65",",","0.8",",","0.9","]",">",">",">","crv.data","[","2","]","[","``","TPR","''","]","[","1.0",",","1.0",",","1.0",",","0.5",",","0.5",",","0.5",",","0.5",",","0.0","]",">",">",">","crv.data","[","2","]","[","``","FPR","''","]","[","1.0",",","0.5",",","0.5",",","0.5",",","0.0",",","0.0",",","0.0",",","0.0","]",">",">",">","auc_trp","=","crv.area","(",")",">",">",">","auc_trp","[","1","]","0.75",">",">",">","auc_trp","[","2","]","0.75",">",">",">","auc_mid","=","crv.area","(","method=","''","midpoint","''",")",">",">",">","auc_mid","[","1","]","0.75",">",">",">","auc_mid","[","2","]","0.75"]
docstr: Compute Area Under Curve (AUC) using trapezoidal or midpoint numerical integral technique.
  
  :param method: numerical integral technique (trapezoidal or midpoint)
  :type method: str
  :return: Area Under Curve (AUC) values of all classes as dict
docstr_tok: ["Compute","Area","Under","Curve","(","AUC",")","using","trapezoidal","or","midpoint","numerical","integral","technique",".",":","param","method",":","numerical","integral","technique","(","trapezoidal","or","midpoint",")",":","type","method",":","str",":","return",":","Area","Under","Curve","(","AUC",")","values","of","all","classes","as","dict"]
code: def area(self, method="trapezoidal"):
      """
      Compute Area Under Curve (AUC) using trapezoidal or midpoint numerical integral technique.
  
      :param method: numerical integral technique (trapezoidal or midpoint)
      :type method: str
      :return: Area Under Curve (AUC) values of all classes as dict
      """
      for c in self.classes:
          x = self.data[c][self.plot_x_axis]
          y = self.data[c][self.plot_y_axis]
          dx = numpy.diff(x)
          if numpy.any(dx < 0) and numpy.any(dx > 0):
              sort_indices = numpy.argsort(x, kind="mergesort")
              self.data[c][self.plot_x_axis] = x = numpy.array(x)[
                  sort_indices
              ].tolist()
              self.data[c][self.plot_y_axis] = y = numpy.array(y)[
                  sort_indices
              ].tolist()
          if method == "trapezoidal":
              self.auc[c] = __trapezoidal_numeric_integral__(x, y)
          elif method == "midpoint":
              self.auc[c] = __midpoint_numeric_integral__(x, y)
          else:
              raise pycmCurveError(AREA_METHOD_ERROR)
      return self.auc
  
imports: from __future__ import division
  from .pycm_error import pycmCurveError, pycmPlotError
  from .pycm_util import threshold_func, thresholds_calc, isfloat
  from .pycm_param import *
  from .pycm_obj import ConfusionMatrix
  from warnings import warn
  import numpy
label_desc: Use image node_id 2 for calling the Curve obj's underlying member method code with example usage: obj.area(method) and returns: self