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: Init method.
  
  :param actual_vector: actual vector
  :type actual_vector: list or numpy array of any stringable objects
  :param probs: probabilities
  :type probs: list or numpy array
  :param classes: ordered labels of classes
  :type classes: list
  :param thresholds: thresholds list
  :type thresholds: list or numpy array
  :param sample_weight: sample weights list
  :type sample_weight: list or numpy array
docstr_tok: ["Init","method",".",":","param","actual_vector",":","actual","vector",":","type","actual_vector",":","list","or","numpy","array","of","any","stringable","objects",":","param","probs",":","probabilities",":","type","probs",":","list","or","numpy","array",":","param","classes",":","ordered","labels","of","classes",":","type","classes",":","list",":","param","thresholds",":","thresholds","list",":","type","thresholds",":","list","or","numpy","array",":","param","sample_weight",":","sample","weights","list",":","type","sample_weight",":","list","or","numpy","array"]
code: def __init__(
      self,
      actual_vector,
      probs,
      classes,
      thresholds=None,
      sample_weight=None,
  ):
      """
      Init method.
  
      :param actual_vector: actual vector
      :type actual_vector: list or numpy array of any stringable objects
      :param probs: probabilities
      :type probs: list or numpy array
      :param classes: ordered labels of classes
      :type classes: list
      :param thresholds: thresholds list
      :type thresholds: list or numpy array
      :param sample_weight: sample weights list
      :type sample_weight: list or numpy array
      """
      self.data = {}
      self.thresholds = []
      self.binary = False
      __curve_validation__(self, actual_vector, probs)
      __curve_classes_handler__(self, classes)
      __curve_thresholds_handler__(self, thresholds)
      for c_index, c in enumerate(self.classes):
          data_temp = {item: [] for item in CURVE_PARAMS}
          for t in self.thresholds:
  
              def lambda_fun(x):
                  return threshold_func(x, c_index, self.classes, t)
  
              cm = ConfusionMatrix(
                  actual_vector=self.actual_vector,
                  predict_vector=self.probs,
                  threshold=lambda_fun,
                  sample_weight=sample_weight,
              )
              for item in CURVE_PARAMS:
                  data_temp[item].append(getattr(cm, item)[c])
          self.data[c] = data_temp
      self.auc = {}
      self.plot_x_axis = "FPR"
      self.plot_y_axis = "TPR"
      self.title = "{0} per {1}".format(
          self.plot_x_axis, self.plot_y_axis
      )
  
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 1 to create a new Curve object  with example: obj = Curve(actual_vector, probs, classes, thresholds, sample_weight)