code: def matrix_params_calc(actual_vector, predict_vector, sample_weight):
      
      if isinstance(actual_vector, numpy.ndarray):
          actual_vector = actual_vector.tolist()
      if isinstance(predict_vector, numpy.ndarray):
          predict_vector = predict_vector.tolist()
      classes = set(actual_vector).union(set(predict_vector))
      classes = sorted(classes)
      map_dict = {k: 0 for k in classes}
      table = {k: map_dict.copy() for k in classes}
      weight_vector = [1] * len(actual_vector)
      if isinstance(sample_weight, (list, numpy.ndarray)):
          if len(sample_weight) == len(actual_vector):
              weight_vector = sample_weight
      for index, item in enumerate(actual_vector):
          table[item][predict_vector[index]] += 1 * weight_vector[index]
      [classes, table, TP_dict, TN_dict, FP_dict,
          FN_dict] = matrix_params_from_table(table)
      return [classes, table, TP_dict, TN_dict, FP_dict, FN_dict]
docs: Calculate TP,TN,FP,FN for each class.
  
      :param actual_vector: actual values
      :type actual_vector : list
      :param predict_vector: predict value
      :type predict_vector : list
      :param sample_weight : sample weights list
      :type sample_weight : list
      :return: [classes_list,table,TP,TN,FP,FN]