class_docstr: Base Stochastic Gradient Tree (SGT) class.
  
  This class defines the main characteristics that are shared by the different SGT
  implementations.
class_docstr_tok: ["Base","Stochastic","Gradient","Tree","(","SGT",")","class",".","This","class","defines","the","main","characteristics","that","are","shared","by","the","different","SGT","implementations","."]
code: def _compute_p_value(merit, n_observations):
      # Null hypothesis: expected loss is zero
      # Alternative hypothesis: expected loss is not zero
  
      f_value = (
          n_observations
          * (merit.loss_mean * merit.loss_mean)
          / merit.loss_var
          if merit.loss_var > 0.0
          else None
      )
  
      if f_value is None:
          return 1.0
  
      return 1 - f_dist.cdf(f_value, 1, n_observations - 1)
  
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 4 for calling the StochasticGradientTree obj's underlying member method code with example usage: obj._compute_p_value(merit, n_observations) and returns: unknown, int