Subsample data. Data is in the form of a tuple of lists.
(data, subsample_size)
| 2 | |
| 3 | |
| 4 | def subsample_data(data, subsample_size): |
| 5 | """ |
| 6 | Subsample data. Data is in the form of a tuple of lists. |
| 7 | """ |
| 8 | inputs, outputs = data |
| 9 | assert len(inputs) == len(outputs) |
| 10 | indices = random.sample(range(len(inputs)), subsample_size) |
| 11 | inputs = [inputs[i] for i in indices] |
| 12 | outputs = [outputs[i] for i in indices] |
| 13 | return inputs, outputs |
| 14 | |
| 15 | |
| 16 | def create_split(data, split_size): |
nothing calls this directly
no outgoing calls
no test coverage detected