lib/rumale/evaluation_measure/mutual_information.rb in rumale-0.13.8 vs lib/rumale/evaluation_measure/mutual_information.rb in rumale-0.14.0
- old
+ new
@@ -19,11 +19,11 @@
#
# @param y_true [Numo::Int32] (shape: [n_samples]) Ground truth labels.
# @param y_pred [Numo::Int32] (shape: [n_samples]) Predicted cluster labels.
# @return [Float] Mutual information.
def score(y_true, y_pred)
- check_label_array(y_true)
- check_label_array(y_pred)
+ y_true = check_convert_label_array(y_true)
+ y_pred = check_convert_label_array(y_pred)
# initiazlie some variables.
mutual_information = 0.0
n_samples = y_pred.size
class_ids = y_true.to_a.uniq
cluster_ids = y_pred.to_a.uniq