docs: def print_rule(rule, feature_names=None, category_names=None, label="label", support=None):
      # type: (Rule, List[Union[str, None]], List[Union[List[str], None]], str, List[int]) -> str
      """
      print the rule in a nice way
      :param rule: An instance of Rule
      :param feature_names: a list of n_features feature names,
      :param category_names: the names of the categories of each feature.
      :param label: Can take two values, 'label': just print the label as output, or 'prob': print the prob distribution.
      :param support: optional values of the data that support the rule
      :return: str
      """
      pred_label = np.argmax(rule.output)
      if label == "label":
          output = str(pred_label) + " ({})".format(rule.output[pred_label])
      elif label == "prob":
          output = "[{}]".format(", ".join(["{:.4f}".format(prob) for prob in rule.output]))
      else:
          raise ValueError("Unknown label {}".format(label))
      output = "{}: ".format(label) + output
  
      default = rule.is_default()
      if default:
          s = "DEFAULT " + output
      else:
          if feature_names is None:
              _feature_names = ["X" + str(idx) for idx, _ in rule.clauses]
          else:
              _feature_names = [feature_names[idx] for idx, _ in rule.clauses]
  
          categories = []
          for feature_idx, category in rule.clauses:
              if category_names is None:
                  _category_names = None
              else:
                  _category_names = category_names[feature_idx]
              if _category_names is None:
                  categories.append(" = " + str(category))
              else:
                  categories.append(" in " + str(_category_names[category]))
  
          s = "IF "
          # conditions
          conditions = ["({}{})".format(feature, category) for feature, category in zip(_feature_names, categories)]
          s += " AND ".join(conditions)
          # results
          s += " THEN " + output
  
      if support is not None:
          support_list = [("+" if i == pred_label else "-") + str(supp) for i, supp in enumerate(support)]
          s += " [" + "/".join(support_list) + "]"
      return s