def GetAtomicWeightsForModel(probeMol, fpFunction, predictionFunction):
  """
    Calculates the atomic weights for the probe molecule based on
    a fingerprint function and the prediction function of a ML model.

    Parameters:
      probeMol -- the probe molecule
      fpFunction -- the fingerprint function
      predictionFunction -- the prediction function of the ML model
    """
  if hasattr(probeMol, '_fpInfo'):
    delattr(probeMol, '_fpInfo')
  probeFP = fpFunction(probeMol, -1)
  baseProba = predictionFunction(probeFP)
  # loop over atoms
  weights = []
  for atomId in range(probeMol.GetNumAtoms()):
    newFP = fpFunction(probeMol, atomId)
    newProba = predictionFunction(newFP)
    weights.append(baseProba - newProba)
  if hasattr(probeMol, '_fpInfo'):
    delattr(probeMol, '_fpInfo')
  return weights