def load_sparse_csr(filename):
    loader = np.load(filename)
return csr_matrix((loader['data'], loader['indices'], loader['indptr']),
    shape=loader['shape'])
Save / load scipy sparse csr_matrix in portable data format