def save(self,filepath):
        if not filepath.endswith('.npz'):
            raise ValueError('invalid filepath {0}, must have ".npz" suffix'.format(filepath))

        archive = self._create_archive()
        if archive:
            np.savez(filepath,**archive)
        else:
            pickle.dump(self,open(filepath,'w'))
Serialize model to file.
dataset/ETHPy150Open Mendeley/mrec/mrec/base_recommender.py/BaseRecommender.save