Port a method for a single tree.

        Parameters
        ----------
        :param estimator_index : int
            The estimator index.
        :param estimator : AdaBoostClassifier
            The estimator itself.

        Returns
        -------
        :return : string
            The created method as string.

def create_single_method(self, estimator_index, estimator):
        """
        Port a method for a single tree.

        Parameters
        ----------
        :param estimator_index : int
            The estimator index.
        :param estimator : AdaBoostClassifier
            The estimator itself.

        Returns
        -------
        :return : string
            The created method as string.
        """
        feature_indices = []
        for i in estimator.tree_.feature:
            n_features = estimator.n_features_
            if self.n_features > 1 or (self.n_features == 1 and i >= 0):
                feature_indices.append([str(j) for j in range(n_features)][i])

        tree_branches = self.create_branches(
            estimator.tree_.children_left, estimator.tree_.children_right,
            estimator.tree_.threshold, estimator.tree_.value,
            feature_indices, 0, 1, init=True)

        temp_tree = self.temp('embedded.tree')
        return temp_tree.format(method_name=self.method_name,
                                method_index=str(estimator_index),
                                methods=tree_branches,
                                n_classes=self.n_classes)