class_docstr: Base class for decision trees.
  
  Warning: This class should not be used directly.
  Use derived classes instead.
class_docstr_tok: ["Base","class","for","decision","trees",".","Warning",":","This","class","should","not","be","used","directly",".","Use","derived","classes","instead","."]
docstr: Prune tree using Minimal Cost-Complexity Pruning.
docstr_tok: ["Prune","tree","using","Minimal","Cost-Complexity","Pruning","."]
code: def _prune_tree(self):
      """Prune tree using Minimal Cost-Complexity Pruning."""
      check_is_fitted(self)
  
      if self.ccp_alpha < 0.0:
          raise ValueError(
              "ccp_alpha must be greater than or equal to 0"
          )
  
      if self.ccp_alpha == 0.0:
          return
  
      # build pruned tree
      if is_classifier(self):
          n_classes = np.atleast_1d(self.n_classes_)
          pruned_tree = Tree(
              self.n_features_in_, n_classes, self.n_outputs_
          )
      else:
          pruned_tree = Tree(
              self.n_features_in_,
              # TODO: the tree shouldn't need this param
              np.array([1] * self.n_outputs_, dtype=np.intp),
              self.n_outputs_,
          )
      _build_pruned_tree_ccp(pruned_tree, self.tree_, self.ccp_alpha)
  
      self.tree_ = pruned_tree
  
imports: from abc import ABCMeta
  from abc import abstractmethod
  from sklearn.base import MultiOutputMixin
  from sklearn.base import BaseEstimator
  from sklearn.base import is_classifier, clone
  from sklearn.utils import Bunch
  from sklearn.utils.validation import check_is_fitted
  import numpy
  from scipy.sparse import issparse
  from ._tree import Tree
  from ._tree import _build_pruned_tree_ccp
  from ._tree import ccp_pruning_path
  from .None import _tree, _splitter
label_desc: Use image node_id 9 for calling the BaseDecisionTree obj's underlying member method code with example usage: obj._prune_tree() without return types