class_docstr: Extract model data and port a RandomForestClassifier classifier.
class_docstr_tok: ["Extract","model","data","and","port","a","RandomForestClassifier","classifier","."]
docstr: Port a method for a single tree.
  
  Parameters
  ----------
  templates : Dict[str, str]
      All relevant templates.
  language
      The required language.
  converter
      The number converter.
  method_index : str
      The index of a single decision tree.
  class_name : str
      The class name.
  model_data : dict
      The model data of the single decision tree.
  
  Returns
  -------
  out_tree : str
      The created method as string.
docstr_tok: ["Port","a","method","for","a","single","tree",".","Parameters","--","--","--","--","--","templates",":","Dict","[","str",",","str","]","All","relevant","templates",".","language","The","required","language",".","converter","The","number","converter",".","method_index",":","str","The","index","of","a","single","decision","tree",".","class_name",":","str","The","class","name",".","model_data",":","dict","The","model","data","of","the","single","decision","tree",".","Returns","--","--","--","-","out_tree",":","str","The","created","method","as","string","."]
code: def _create_method(
      self,
      templates: Environment,
      language: str,
      converter: Callable[[object], str],
      method_index: str,
      class_name: str,
      model_data: dict,
  ):
      """
      Port a method for a single tree.
  
      Parameters
      ----------
      templates : Dict[str, str]
          All relevant templates.
      language
          The required language.
      converter
          The number converter.
      method_index : str
          The index of a single decision tree.
      class_name : str
          The class name.
      model_data : dict
          The model data of the single decision tree.
  
      Returns
      -------
      out_tree : str
          The created method as string.
      """
      tree = self._create_tree(
          templates,
          language,
          converter,
          model_data.get("lefts"),
          model_data.get("rights"),
          model_data.get("thresholds"),
          model_data.get("classes"),
          model_data.get("indices"),
          0,
          1,
      )
  
      tpl_tree = templates.get_template("combined.tree")
      out_tree = tpl_tree.render(
          tree=tree,
          n_classes=self.meta_info.get("n_classes"),
          n_estimators=self.meta_info.get("n_estimators"),
          method_index=method_index,
          class_name=class_name,
      )
      return out_tree
  
file_path: sklearn-porter/sklearn_porter/estimator/RandomForestClassifier/__init__.py
imports: from copy import deepcopy
  from json import dumps, encoder
  from textwrap import indent
  from typing import Callable, Dict, Tuple, Union
  from loguru import logger
  from jinja2 import Environment
  from sklearn.ensemble.forest import RandomForestClassifier
  from sklearn.tree import DecisionTreeClassifier
  from sklearn_porter import enums
  from sklearn_porter import exceptions
  from sklearn_porter.estimator.EstimatorApiABC import EstimatorApiABC
  from sklearn_porter.estimator.EstimatorBase import EstimatorBase
label_desc: Use image node_id 3 for calling the RandomForestClassifier obj's underlying member method code with example usage: obj._create_method(templates, language, converter, method_index, class_name, model_data) and returns: out_tree