Skip to content
Snippets Groups Projects
Commit 0161d493 authored by tomrink's avatar tomrink
Browse files

minor...

parent 46dfd6c9
No related branches found
No related tags found
No related merge requests found
......@@ -366,6 +366,7 @@ def analyze(ice_dct, no_ice_dct):
print(dt_str[2:])
# This mostly reduces some categories for a degree of class balancing
def process(ice_dct, no_ice_dct, neg_ice_dct):
new_ice_dct = {}
new_no_ice_dct = {}
......@@ -446,14 +447,16 @@ def process(ice_dct, no_ice_dct, neg_ice_dct):
ice_tidx_2 = ice_tidx_2[ridxs]
ice_keys_2 = ice_keys_2[::2]
ice_tidx_2 = ice_tidx_2[::2]
print('2: reduced: ', ice_tidx_2.shape)
ice_keys_1 = np.array(ice_keys_1)
ice_tidx_1 = np.array(ice_tidx_1)
print('1: ', ice_keys_1.shape[0])
print('no intensity: ', no_intensity_cnt)
print('0: ', no_intensity_cnt)
ice_keys = np.concatenate([ice_keys_5_6, ice_keys_1, ice_keys_2, ice_keys_3, ice_keys_4])
ice_tidx = np.concatenate([ice_tidx_5_6, ice_tidx_1, ice_tidx_2, ice_tidx_3, ice_tidx_4])
print('icing total reduced: ', ice_tidx.shape)
sidxs = np.argsort(ice_keys)
ice_keys = ice_keys[sidxs]
......@@ -479,7 +482,7 @@ def process(ice_dct, no_ice_dct, neg_ice_dct):
no_ice_tidx = no_ice_tidx[ridxs]
no_ice_keys = no_ice_keys[::20]
no_ice_tidx = no_ice_tidx[::20]
print('no ice : ', no_ice_keys.shape[0])
print('no ice reduced: ', no_ice_keys.shape[0])
sidxs = np.argsort(no_ice_keys)
no_ice_keys = no_ice_keys[sidxs]
......@@ -500,9 +503,9 @@ def process(ice_dct, no_ice_dct, neg_ice_dct):
print('neg ice total: ', neg_ice_keys.shape[0])
np.random.seed(42)
np.random.shuffle(neg_ice_keys)
neg_ice_keys = neg_ice_keys[0:10000]
neg_ice_keys = neg_ice_keys[0:12000]
uniq_sorted_neg_ice = np.unique(neg_ice_keys)
print('neg ice: ', neg_ice_keys.shape, uniq_sorted_neg_ice.shape)
print('neg ice reduced: ', uniq_sorted_neg_ice.shape)
for key in uniq_sorted_neg_ice:
new_neg_ice_dct[key] = neg_ice_dct[key]
......
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