code: def test_ripper_adult(self):
      data_type = {
          "age": float,
          "workclass": str,
          "fnlwgt": float,
          "education": str,
          "education-num": float,
          "marital-status": str,
          "occupation": str,
          "relationship": str,
          "race": str,
          "sex": str,
          "capital-gain": float,
          "capital-loss": float,
          "native-country": str,
          "hours-per-week": float,
          "label": str,
      }
  
      col_names = [
          "age",
          "workclass",
          "fnlwgt",
          "education",
          "education-num",
          "marital-status",
          "occupation",
          "relationship",
          "race",
          "sex",
          "capital-gain",
          "capital-loss",
          "hours-per-week",
          "native-country",
          "label",
      ]
  
      df = pd.read_csv(
          "https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data",
          header=None,
          delimiter=", ",
          engine="python",
          names=col_names,
          dtype=data_type,
      )
      df.columns = df.columns.str.replace("-", "_")
  
      # first tests all cells then find all rows
      df = df[(df.astype(str) != "?").all(axis=1)]
      data_train, data_test = train_test_split(
          df, test_size=0.5, random_state=1
      )
  
      train_labels = data_train.columns[:-1]
      test_label = data_test.columns[-1]
  
      x_train = data_train.loc[:, train_labels]
      y_train = data_train.loc[:, test_label]
  
      x_test = data_test.loc[:, train_labels]
      y_test = data_test.loc[:, test_label]
  
      generator = RipperRuleSetGenerator()
      ruleset = generator.generate(
          x_train, y_train, ">50K", d=64, k=2, pruning_threshold=100
      )
      classifier = RuleSetClassifier(
          [ruleset],
          rule_selection_method=RuleSelectionMethod.WEIGHTED_MAX,
          confidence_metric=ConfidenceMetric.LAPLACE,
          weight_metric=WeightMetric.CONFIDENCE,
          default_label="<=50K",
      )
      classifier.update_rules_with_metrics(x_test, y_test)
      reader = TrxfReader()
      reader.load_data_dictionary(x_test)
      serializer = NyokaSerializer(TIMESTAMP)
      exporter = PmmlExporter(reader, serializer)
      filename = (
          "adult.pmml" if sys.version_info[1] > 6 else "adult_py36.pmml"
      )
      with open(
          os.path.join(
              os.path.dirname(os.path.abspath(__file__)),
              "resources",
              filename,
          )
      ) as file:
          expected = file.read()
      actual = exporter.export(classifier)
  
file_path: AIX360/tests/rule_induction/trxf/pmml_export/test_pmml_exporter.py
imports: import datetime
  import os
  import sys
  from unittest import TestCase
  import pandas
  from sklearn.model_selection import train_test_split
  from aix360.algorithms.rule_induction.ripper import RipperExplainer
  from aix360.algorithms.rule_induction.ripper.ripper_ruleset_generator import RipperRuleSetGenerator
  from aix360.algorithms.rule_induction.trxf.classifier.ruleset_classifier import RuleSetClassifier, RuleSelectionMethod, WeightMetric, ConfidenceMetric
  from aix360.algorithms.rule_induction.trxf.pmml_export import NyokaSerializer
  from aix360.algorithms.rule_induction.trxf.pmml_export.pmml_exporter import PmmlExporter
  from aix360.algorithms.rule_induction.trxf.pmml_export.reader.trxf_reader import TrxfReader
  from tests.rule_induction.trxf.utilities import create_test_ruleset, DATA_FRAME
label_desc: Use image node_id 4 for calling the TestPmmlExporter obj's underlying member method code with example usage: obj.test_ripper_adult() without return types