docstr: This actually computes q times the slope, which has the same sign as the slope since q is positive.
  score = Y log q + \sum_i (p_i - qp_i)
  dscore/dq = Y / q - \sum_i(p_i)
  q dscore/dq = q_dscore = Y - (q * \sum_i(p_i))
  
  :param observed_sum: sum of observed binary outcomes for all i
  :param expectations: predicted outcomes for each data element i
  :param q: current value of q
  :return: q dscore/dq
code: def q_dscore(self, observed_sum, expectations, q):
      """
      This actually computes q times the slope, which has the same sign as the slope since q is positive.
      score = Y log q + \sum_i (p_i - qp_i)
      dscore/dq = Y / q - \sum_i(p_i)
      q dscore/dq = q_dscore = Y - (q * \sum_i(p_i))
  
      :param observed_sum: sum of observed binary outcomes for all i
      :param expectations: predicted outcomes for each data element i
      :param q: current value of q
      :return: q dscore/dq
      """
      ans = observed_sum - (q * expectations).sum()
      return ans
  
file_path: AIF360/aif360/detectors/mdss/ScoringFunctions/Poisson.py
imports: from aif360.detectors.mdss.ScoringFunctions.ScoringFunction import ScoringFunction
  from aif360.detectors.mdss.ScoringFunctions import optim
  import numpy
label_desc: Use image node_id 5 for calling the Poisson obj's underlying member method code with example usage: obj.q_dscore(observed_sum, expectations, q) and returns: ans