def viz_missing_docwordfreq_stats(DocWordFreq_emp, DocWordFreq_model):
  from matplotlib import pylab
  DocWordFreq_missing = np.maximum(DocWordFreq_emp - DocWordFreq_model, 0)

  nnzEmp = count_num_nonzero(DocWordFreq_emp)
  nnzMiss = count_num_nonzero(DocWordFreq_missing)
  frac_nzMiss = nnzMiss / float(nnzEmp)

  nzMissPerDoc = np.sum(DocWordFreq_missing > 0, axis=1)
  CDF_nzMissPerDoc = np.sort(nzMissPerDoc)
  nzMissPerWord = np.sum(DocWordFreq_missing > 0, axis=0)
  CDF_nzMissPerWord = np.sort(nzMissPerWord)

  pylab.subplot(1,2,1)
  pylab.plot(CDF_nzMissPerDoc)
  pylab.ylabel('Num Nonzero Entries in Doc')
  pylab.xlabel('Document rank | frac= %.4f'% (frac_nzMiss))
  pylab.subplot(1,2,2)
  pylab.plot(CDF_nzMissPerWord)
  pylab.ylabel('Num Nonzero Entries per Word')
  pylab.xlabel('Word rank')

  pylab.show(block=True)
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/learnalg/BirthMoveTopicModel.py/viz_missing_docwordfreq_stats/original