code: def expected_costs(self, class_probs, inst=None):
          
          if inst is None:
              costs = javabridge.call(
                  self.jobject, "expectedCosts", "([D)[D", javabridge.get_env().make_double_array(class_probs))
              return javabridge.get_env().get_double_array_elements(costs)
          else:
              costs = javabridge.call(
                  self.jobject, "expectedCosts", "([DLweka/core/Instance;)[D",
                  javabridge.get_env().make_double_array(class_probs), inst.jobject)
              return javabridge.get_env().get_double_array_elements(costs)
docs: Calculates the expected misclassification cost for each possible class value, given class probability
          estimates.
  
          :param class_probs: the class probabilities
          :type class_probs: ndarray
          :return: the calculated costs
          :rtype: ndarray