Skip to content

Instantly share code, notes, and snippets.

@dragonflowerai
Created November 16, 2018 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dragonflowerai/f2adef1b40a789ff83cbf378ba9020b3 to your computer and use it in GitHub Desktop.
Save dragonflowerai/f2adef1b40a789ff83cbf378ba9020b3 to your computer and use it in GitHub Desktop.
def split_by_idx(self, valid_idx:Collection[int])->'ItemLists':
"Split the data according to the indexes in `valid_idx`."
train_idx = list(set(np.arange(len(self.items)))-set(valid_idx))
return self.split_by_idxs(train_idx, valid_idx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment