class_docstr: Stochastic Gradient Tree[^1] for binary classification.
  
  Binary decision tree classifier that minimizes the binary cross-entropy to guide its growth.
  
  Stochastic Gradient Trees (SGT) directly minimize a loss function to guide tree growth and
  update their predictions. Thus, they differ from other incrementally tree learners that do
  not directly optimize the loss, but data impurity-related heuristics.
  
  Parameters
  ----------
  delta
      Define the significance level of the F-tests performed to decide upon creating splits
      or updating predictions.
  grace_period
      Interval between split attempts or prediction updates.
  init_pred
      Initial value predicted by the tree.
  max_depth
      The maximum depth the tree might reach. If set to `None`, the trees will grow
      indefinitely.
  lambda_value
      Positive float value used to impose a penalty over the tree's predictions and force
      them to become smaller. The greater the lambda value, the more constrained are the
      predictions.
  gamma
      Positive float value used to impose a penalty over the tree's splits and force them to
      be avoided when possible. The greater the gamma value, the smaller the chance of a
      split occurring.
  nominal_attributes
      List with identifiers of the nominal attributes. If None, all features containing
      numbers are assumed to be numeric.
  feature_quantizer
      The algorithm used to quantize numeric features. Either a static quantizer (as in the
      original implementation) or a dynamic quantizer can be used. The correct choice and setup
      of the feature quantizer is a crucial step to determine the performance of SGTs.
      Feature quantizers are akin to the attribute observers used in Hoeffding Trees. By
      default, an instance of `tree.splitter.StaticQuantizer` (with default parameters) is
      used if this parameter is not set.
  
  Examples
  --------
  >>> from river import datasets
  >>> from river import evaluate
  >>> from river import metrics
  >>> from river import tree
  
  >>> dataset = datasets.Phishing()
  >>> model = tree.SGTClassifier(
  ...     feature_quantizer=tree.splitter.StaticQuantizer(
  ...         n_bins=32, warm_start=10
  ...     )
  ... )
  >>> metric = metrics.Accuracy()
  
  >>> evaluate.progressive_val_score(dataset, model, metric)
  Accuracy: 82.24%
  
  References
  ----------
  [^1]: Gouk, H., Pfahringer, B., & Frank, E. (2019, October). Stochastic Gradient Trees.
  In Asian Conference on Machine Learning (pp. 1094-1109).
class_docstr_tok: ["Stochastic","Gradient","Tree","[","^1","]","for","binary","classification",".","Binary","decision","tree","classifier","that","minimizes","the","binary","cross-entropy","to","guide","its","growth",".","Stochastic","Gradient","Trees","(","SGT",")","directly","minimize","a","loss","function","to","guide","tree","growth","and","update","their","predictions",".","Thus",",","they","differ","from","other","incrementally","tree","learners","that","do","not","directly","optimize","the","loss",",","but","data","impurity-related","heuristics",".","Parameters","--","--","--","--","--","delta","Define","the","significance","level","of","the","F-tests","performed","to","decide","upon","creating","splits","or","updating","predictions",".","grace_period","Interval","between","split","attempts","or","prediction","updates",".","init_pred","Initial","value","predicted","by","the","tree",".","max_depth","The","maximum","depth","the","tree","might","reach",".","If","set","to","`","None","`",",","the","trees","will","grow","indefinitely",".","lambda_value","Positive","float","value","used","to","impose","a","penalty","over","the","tree","'s","predictions","and","force","them","to","become","smaller",".","The","greater","the","lambda","value",",","the","more","constrained","are","the","predictions",".","gamma","Positive","float","value","used","to","impose","a","penalty","over","the","tree","'s","splits","and","force","them","to","be","avoided","when","possible",".","The","greater","the","gamma","value",",","the","smaller","the","chance","of","a","split","occurring",".","nominal_attributes","List","with","identifiers","of","the","nominal","attributes",".","If","None",",","all","features","containing","numbers","are","assumed","to","be","numeric",".","feature_quantizer","The","algorithm","used","to","quantize","numeric","features",".","Either","a","static","quantizer","(","as","in","the","original","implementation",")","or","a","dynamic","quantizer","can","be","used",".","The","correct","choice","and","setup","of","the","feature","quantizer","is","a","crucial","step","to","determine","the","performance","of","SGTs",".","Feature","quantizers","are","akin","to","the","attribute","observers","used","in","Hoeffding","Trees",".","By","default",",","an","instance","of","`","tree.splitter.StaticQuantizer","`","(","with","default","parameters",")","is","used","if","this","parameter","is","not","set",".","Examples","--","--","--","--",">",">",">","from","river","import","datasets",">",">",">","from","river","import","evaluate",">",">",">","from","river","import","metrics",">",">",">","from","river","import","tree",">",">",">","dataset","=","datasets.Phishing","(",")",">",">",">","model","=","tree.SGTClassifier","(","...","feature_quantizer=tree.splitter.StaticQuantizer","(","...","n_bins=32",",","warm_start=10","...",")","...",")",">",">",">","metric","=","metrics.Accuracy","(",")",">",">",">","evaluate.progressive_val_score","(","dataset",",","model",",","metric",")","Accuracy",":","82.24","%","References","--","--","--","--","--","[","^1","]",":","Gouk",",","H.",",","Pfahringer",",","B.",",","&","Frank",",","E.","(","2019",",","October",")",".","Stochastic","Gradient","Trees",".","In","Asian","Conference","on","Machine","Learning","(","pp",".","1094-1109",")","."]
code: def predict_proba_one(
      self, x: dict
  ) -> dict[base.typing.ClfTarget, float]:
      if isinstance(self._root, DTBranch):
          leaf = self._root.traverse(x, until_leaf=True)
      else:
          leaf = self._root
  
      t_proba = self.loss_func.transfer(leaf.prediction())  # type: ignore
  
      return {True: t_proba, False: 1 - t_proba}
  
imports: from __future__ import annotations
  import abc
  import math
  from scipy.stats import f
  from river import base, tree
  from .losses import BinaryCrossEntropyLoss, SquaredErrorLoss
  from .nodes.branch import DTBranch, NominalMultiwayBranch, NumericBinaryBranch
  from .nodes.sgt_nodes import SGTLeaf
  from .utils import BranchFactory, GradHessMerit
label_desc: Use image node_id 3 for calling the SGTClassifier obj's underlying member method code with example usage: obj.predict_proba_one(x) and returns: dict