code: def has_imbalanced_output(base_config, features_metadata) -> bool:
      """Check binary and category output feature(s) for imbalance, i.e., low minority/majority instance count
      ratio."""
      imbalanced_output = False
      for output_feature in base_config["output_features"]:
          if (
              output_feature[TYPE] == BINARY
              or output_feature[TYPE] == CATEGORY
          ):
              for feature_metadata in features_metadata:
                  if output_feature[NAME] == feature_metadata.name:
                      if (
                          feature_metadata.imbalance_ratio
                          < IMBALANCE_DETECTION_RATIO
                      ):
                          logger.info(
                              f"Imbalance in {output_feature[NAME]}: minority/majority={feature_metadata.imbalance_ratio}"
                          )
                          imbalanced_output = True
                      break
      return imbalanced_output
  
file_path: ludwig/ludwig/utils/automl/utils.py
imports: import bisect
  import logging
  from typing import Dict
  from numpy import nan_to_num
  from pandas import Series
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import BINARY, CATEGORY, COMBINER, CONFIG, HYPEROPT, IMBALANCE_DETECTION_RATIO, NAME, NUMBER, PARAMETERS, SEARCH_ALG, TRAINER, TYPE
  from ludwig.features.feature_registries import get_output_type_registry
  from ludwig.modules.metric_registry import get_metric_objective
  from ludwig.schema.combiners.utils import get_combiner_jsonschema
label_desc: Use image node_id 8 for calling a global function with example usage: has_imbalanced_output(base_config, features_metadata) and returns: imbalanced_output