docstr: Translate a TRXF RuleSetClassifier to an internal SimplePMMLRuleSetModel
docstr_tok: ["Translate","a","TRXF","RuleSetClassifier","to","an","internal","SimplePMMLRuleSetModel"]
code: def read(
      self, trxf_classifier: RuleSetClassifier
  ) -> models.SimplePMMLRuleSetModel:
      """
      Translate a TRXF RuleSetClassifier to an internal SimplePMMLRuleSetModel
      """
      trxf_to_pmml_rule_selection_map = {
          ruleset_classifier.RuleSelectionMethod.FIRST_HIT: models.RuleSelectionMethod.firstHit,
          ruleset_classifier.RuleSelectionMethod.WEIGHTED_SUM: models.RuleSelectionMethod.weightedSum,
          ruleset_classifier.RuleSelectionMethod.WEIGHTED_MAX: models.RuleSelectionMethod.weightedMax,
      }
      trxf_rules = trxf_classifier.rules
      mining_schema = _extract_mining_schema(trxf_rules)
      simple_rules = _convert_to_simple_rules(trxf_rules)
      ruleset = models.RuleSet(
          ruleSelectionMethod=[
              trxf_to_pmml_rule_selection_map[
                  trxf_classifier.rule_selection_method
              ]
          ],
          rules=simple_rules,
          defaultScore=str(trxf_classifier.default_label),
      )
      rule_set_model = models.RuleSetModel(
          miningSchema=mining_schema, ruleSet=ruleset
      )
      assert self._data_dictionary is not None
      return models.SimplePMMLRuleSetModel(
          dataDictionary=self._data_dictionary,
          ruleSetModel=rule_set_model,
      )
  
file_path: AIX360/aix360/algorithms/rule_induction/trxf/pmml_export/reader/trxf_reader.py
imports: from typing import Dict
  import numpy
  import pandas
  from aix360.algorithms.rule_induction.trxf.classifier import ruleset_classifier
  from aix360.algorithms.rule_induction.trxf.classifier.ruleset_classifier import RuleSetClassifier
  from aix360.algorithms.rule_induction.trxf.core import Conjunction, Relation
  from aix360.algorithms.rule_induction.trxf.pmml_export import models
  from aix360.algorithms.rule_induction.trxf.pmml_export.models.data_dictionary import Value
  from aix360.algorithms.rule_induction.trxf.pmml_export.reader import AbstractReader
  from aix360.algorithms.rule_induction.trxf.pmml_export.models import SimplePredicate, Operator, CompoundPredicate, BooleanOperator
label_desc: Use image node_id 3 for calling the TrxfReader obj's underlying member method code with example usage: obj.read(trxf_classifier) and returns: models