def train(self):
        if self.matrix.size > 0:
            n_docs = np.float64(self.matrix.shape[1])
            
            for i in xrange(self.matrix.indptr.shape[0] - 1):

                start = self.matrix.indptr[i]
                stop = self.matrix.indptr[i + 1]

                if start == stop:
                    self.undefined_rows.append(i)
                else:
                    row = self.matrix.data[start:stop]
                    row *= np.log(n_docs / np.count_nonzero(row))
                    start = stop
Computes the IDF values for the input term-frequency matrix,
dataset/ETHPy150Open inpho/vsm/vsm/model/tfidf.py/TfIdf.train