code: def run_error_analyzer(
      model,
      X_test,
      y_test,
      feature_names,
      categorical_features,
      model_task,
      filters=None,
      composite_filters=None,
      matrix_features=None,
      quantile_binning=False,
      num_bins=BIN_THRESHOLD,
      metric=None,
  ):
      error_analyzer = ModelAnalyzer(
          model,
          X_test,
          y_test,
          feature_names,
          categorical_features,
          model_task=model_task,
          metric=metric,
      )
      # features, filters, composite_filters
      if matrix_features is None:
          features = [feature_names[0], feature_names[1]]
      else:
          features = matrix_features
  
      # Validate compute_matrix_on_dataset() output
      matrix = error_analyzer.compute_matrix(
          features,
          filters,
          composite_filters,
          quantile_binning=quantile_binning,
          num_bins=num_bins,
      )
      validation_data = X_test.copy()
      y_test_validation = y_test
      if filters is not None or composite_filters is not None:
          validation_data = filter_from_cohort(
              error_analyzer, filters, composite_filters
          )
          y_test_validation = validation_data[TRUE_Y]
          validation_data = validation_data.drop(
              columns=[TRUE_Y, ROW_INDEX]
          )
          if not isinstance(X_test, pd.DataFrame):
              validation_data = validation_data.values
      expected_count = len(validation_data)
      metric = error_analyzer.metric
      expected_error = get_expected_metric_error(
          error_analyzer,
          metric,
          model,
          validation_data,
          y_test_validation,
      )
      validate_matrix(
          matrix,
          expected_count,
          expected_error,
          features,
          metric=metric,
      )
  
      # Validate compute_matrix_on_dataset() output
      dataset = X_test.copy()
      if not isinstance(dataset, pd.DataFrame):
          dataset = pd.DataFrame(data=dataset, columns=feature_names)
      dataset[TRUE_Y] = y_test
      dataset[ROW_INDEX] = np.arange(0, len(y_test))
  
      new_matrix = error_analyzer.compute_matrix_on_dataset(
          features,
          dataset,
          quantile_binning=quantile_binning,
          num_bins=num_bins,
      )
      expected_count = len(dataset)
      metric = error_analyzer.metric
  
      if not isinstance(X_test, pd.DataFrame):
          dataset = dataset.drop(columns=[TRUE_Y, ROW_INDEX]).values
      else:
          dataset = dataset.drop(columns=[TRUE_Y, ROW_INDEX])
  
      expected_error = get_expected_metric_error(
          error_analyzer, metric, model, dataset, y_test
      )
      validate_matrix(
          new_matrix,
          expected_count,
          expected_error,
          features,
          metric=metric,
      )
  
imports: import numpy
  import pandas
  import pytest
  from erroranalysis._internal.cohort_filter import filter_from_cohort
  from erroranalysis._internal.constants import ARG, COLUMN, METHOD, ROW_INDEX, TRUE_Y, MatrixParams, Metrics, ModelTask, f1_metrics, metric_to_display_name, precision_metrics, recall_metrics
  from erroranalysis._internal.error_analyzer import ModelAnalyzer
  from erroranalysis._internal.matrix_filter import CATEGORY1, CATEGORY2, COUNT, FALSE_COUNT, FN, FP, INTERVAL_MAX, INTERVAL_MIN, MATRIX, METRIC_NAME, METRIC_VALUE, TN, TP, VALUES, bin_data
  from erroranalysis._internal.metrics import get_ordered_classes, is_multi_agg_metric, metric_to_func
  from rai_test_utils.datasets.tabular import create_adult_census_data, create_binary_classification_dataset, create_cancer_data, create_diabetes_data, create_housing_data, create_iris_data, create_simple_titanic_data, create_wine_data
  from rai_test_utils.models.model_utils import create_models_classification, create_models_regression
  from rai_test_utils.models.sklearn import create_kneighbors_classifier, create_titanic_pipeline
  from raiutils.exceptions import UserConfigValidationException
label_desc: Use image node_id 2 for calling a global function with example usage: run_error_analyzer(model, X_test, y_test, feature_names, categorical_features, model_task, filters, composite_filters, matrix_features, quantile_binning, num_bins, metric) without return types