MCPcopy Create free account
hub / github.com/dblalock/bolt / extract_random_rows

Function extract_random_rows

experiments/python/datasets.py:111–117  ·  view source on GitHub ↗
(X, how_many, remove_from_X=True)

Source from the content-addressed store, hash-verified

109
110
111def extract_random_rows(X, how_many, remove_from_X=True):
112 split_start = np.random.randint(len(X) - how_many - 1)
113 split_end = split_start + how_many
114 rows = np.copy(X[split_start:split_end])
115 if remove_from_X:
116 return np.vstack((X[:split_start], X[split_end:])), rows
117 return X, rows
118
119
120def _load_complete_dataset(which_dataset, num_queries=10):

Callers 2

_load_complete_datasetFunction · 0.85
load_datasetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected