Skip to content
Snippets Groups Projects
Commit 4168d11e authored by tomrink's avatar tomrink
Browse files

keep only < 273 for both icing and no-icing regions

parent cdab4bec
No related branches found
No related tags found
No related merge requests found
......@@ -1220,3 +1220,25 @@ def run_mean_std(check_cloudy=False, no_icing_to_icing_ratio=5):
[h5f.close() for h5f in no_ice_h5f_lst]
return mean_dct, std_dct
def split_data(num_obs, perc=0.2, skip=1):
idxs = np.arange(num_obs)
idxs = list(idxs)
num_test = int(num_obs * perc)
skip = int(num_obs / num_test)
test_idxs = idxs[::skip]
test_set = set(test_idxs)
train_set = (set(idxs)).difference(test_set)
train_idxs = list(train_set)
test_idxs = np.array(test_idxs)
train_idxs = np.array(train_idxs)
np.random.shuffle(test_idxs)
np.random.shuffle(train_idxs)
return train_idxs[::skip], test_idxs[::skip]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment