class_docstr: Dictionary-like object representing an SALib Problem specification.
  
  Attributes
  ----------
  samples : np.array, of generated samples
  results : np.array, of evaluations (i.e., model outputs)
  analysis : np.array or dict, of sensitivity indices
docstr: Analyze sampled results using given function.
  
  Parameters
  ----------
  func : function,
      Analysis method to use. The provided function must accept the
      problem specification as the first parameter, X values if needed,
      Y values, and return a numpy array.
  
  *args : list,
      Additional arguments to be passed to `func`
  
  nprocs : int,
      If specified, attempts to parallelize model evaluations
  
  **kwargs : dict,
      Additional keyword arguments passed to `func`
  
  Returns
  -------
  self : ProblemSpec object
docstr_tok: ["Analyze","sampled","results","using","given","function",".","Parameters","--","--","--","--","--","func",":","function",",","Analysis","method","to","use",".","The","provided","function","must","accept","the","problem","specification","as","the","first","parameter",",","X","values","if","needed",",","Y","values",",","and","return","a","numpy","array",".","*","args",":","list",",","Additional","arguments","to","be","passed","to","`","func","`","nprocs",":","int",",","If","specified",",","attempts","to","parallelize","model","evaluations","*","*","kwargs",":","dict",",","Additional","keyword","arguments","passed","to","`","func","`","Returns","--","--","--","-","self",":","ProblemSpec","object"]
code: def analyze(self, func, *args, **kwargs):
      """Analyze sampled results using given function.
  
      Parameters
      ----------
      func : function,
          Analysis method to use. The provided function must accept the
          problem specification as the first parameter, X values if needed,
          Y values, and return a numpy array.
  
      *args : list,
          Additional arguments to be passed to `func`
  
      nprocs : int,
          If specified, attempts to parallelize model evaluations
  
      **kwargs : dict,
          Additional keyword arguments passed to `func`
  
      Returns
      -------
      self : ProblemSpec object
      """
      if self["num_vars"] == 1 or (
          self["groups"] and len("groups") == 1
      ):
          msg = (
              "There is only a single parameter or group defined. There is "
              "no point in conducting sensitivity analysis as any and all"
              "effect(s) will be mapped to the single parameter/group."
          )
          raise ValueError(msg)
  
      if "nprocs" in kwargs:
          # Call parallel method instead
          return self.analyze_parallel(func, *args, **kwargs)
  
      if self._results is None:
          raise RuntimeError("Model not yet evaluated")
  
      if "X" in func.__code__.co_varnames:
          # enforce passing of X if expected
          func = partial(func, *args, X=self._samples, **kwargs)
      else:
          func = partial(func, *args, **kwargs)
  
      out_cols = self.get("outputs", None)
      if out_cols is None:
          if len(self._results.shape) == 1:
              self["outputs"] = ["Y"]
          else:
              num_cols = self._results.shape[1]
              self["outputs"] = [
                  f"Y{i}" for i in range(1, num_cols + 1)
              ]
  
      if len(self["outputs"]) > 1:
          self._analysis = {}
          for i, out in enumerate(self["outputs"]):
              self._analysis[out] = func(self, Y=self._results[:, i])
      else:
          self._analysis = func(self, Y=self._results)
  
      return self
  
imports: import warnings
  import importlib
  from types import MethodType
  from functools import partial, wraps
  from multiprocess import Pool, cpu_count
  import numpy
  import SALib.sample
  import SALib.analyze
  from SALib.util import avail_approaches
  from SALib.util.results import ResultDict
label_desc: Use image node_id 13 for calling the ProblemSpec obj's underlying member method code with example usage: obj.analyze(func) and returns: self, self