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.
code: def _prune_tree(self):
      """Prune tree using Minimal Cost-Complexity Pruning."""
      check_is_fitted(self)
  
      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: import copy
  import numbers
  from abc import ABCMeta, abstractmethod
  from math import ceil
  from numbers import Integral, Real
  import numpy
  from scipy.sparse import issparse
  from ..base import BaseEstimator, ClassifierMixin, MultiOutputMixin, RegressorMixin, _fit_context, clone, is_classifier
  from ..utils import Bunch, check_random_state, compute_sample_weight
  from ..utils._param_validation import Hidden, Interval, RealNotInt, StrOptions
  from ..utils.multiclass import check_classification_targets
  from ..utils.validation import _assert_all_finite_element_wise, _check_sample_weight, assert_all_finite, check_is_fitted
  from .None import _criterion, _splitter, _tree
  from ._criterion import Criterion
  from ._splitter import Splitter
  from ._tree import BestFirstTreeBuilder, DepthFirstTreeBuilder, Tree, _build_pruned_tree_ccp, ccp_pruning_path
  from ._utils import _any_isnan_axis0
label_desc: Use image node_id 11 for calling the BaseDecisionTree obj's underlying member method code with example usage: obj._prune_tree() without return types