torch_frame.utils.generate_random_split

generate_random_split(length: int, seed: int, train_ratio: float = 0.8, val_ratio: float = 0.1, include_test: bool = True) ndarray[source]

Generate a list of random split assignments of the specified length. The elements are either 0, 1, or 2, representing train, val, test, respectively. Note that this function relies on the fact that numpy’s shuffle is consistent across versions, which has been historically the case.