def load_csr(f, return_y=False): npz = np.load(f) X = csr_matrix((npz['data'], npz['indices'], npz['indptr']), shape=npz['shape']) if return_y: return X, npz['y'] else: return X