random_split#
- deeptrack.sources.base.random_split(source: ~deeptrack.sources.base.Source, lengths: ~typing.List[int | float], generator: ~numpy.random._generator.Generator = Generator(PCG64) at 0x7FA4F4D73BA0) List[Subset]#
Randomly split source into non-overlapping new sources of given lengths.
Parameters#
- source: Source
The source to split.
- lengths: list of int or float
The lengths of the new sources. If the lengths are floats, they are interpreted as fractions of the source.
- generator: numpy.random.Generator, optional
The random number generator to use.