def _load_archive(self,archive):
        """
        Load fields from a numpy archive.
        """
        if 'mat' in archive.files:
            self.similarity_matrix = archive['mat']
        elif 'row' in archive.files:
            data = archive['data']
            row = archive['row']
            col = archive['col']
            shape = archive['shape']
            self.similarity_matrix = coo_matrix((data,(row,col)),shape=shape).tocsr()
        else:
            raise IOError('unexpected serialization format, cannot find similarity matrix')
dataset/ETHPy150Open Mendeley/mrec/mrec/item_similarity/recommender.py/ItemSimilarityRecommender._load_archive/original