MCPcopy Create free account
hub / github.com/PAIR-code/lit / shuffle

Method shuffle

lit_nlp/api/dataset.py:230–233  ·  view source on GitHub ↗

Return a new dataset with randomized example order.

(self, seed=42)

Source from the content-addressed store, hash-verified

228 return Dataset(examples=selected_examples, base=self)
229
230 def shuffle(self, seed=42):
231 """Return a new dataset with randomized example order."""
232 # random.shuffle will shuffle in-place; use sample to make a new list.
233 return self.sample(n=len(self), seed=seed)
234
235 def remap(self, field_map: Mapping[str, str]):
236 """Return a copy of this dataset with some fields renamed."""

Callers 2

_scrambleFunction · 0.80
trainMethod · 0.80

Calls 1

sampleMethod · 0.95

Tested by

no test coverage detected