@@ -77,7 +77,7 @@ def indicator_wets_only(self, make_new=False):
77
77
78
78
else :
79
79
print ('Finding optimum criteria; will take a bit' )
80
- dtw_tests = np .arange (0 , 1 , 0.1 )
80
+ dtw_tests = np .arange (0 , 1 , 0.01 )
81
81
hrs_tests = range (3000 , self .mat_dtw .shape [1 ])
82
82
mat_all = np .zeros ([len (dtw_tests ) * len (hrs_tests ), 7 ])
83
83
@@ -93,15 +93,17 @@ def indicator_wets_only(self, make_new=False):
93
93
mat_good = mat_all [mat_all [:,2 ]> 0 ]
94
94
mat_good [:, 3 ] = mat_good [:,2 ]/ float (mat_wet_dtw .shape [0 ])
95
95
mat_best = mat_good [mat_good [:,4 ] >= 0.90 ]
96
- mat_best [:, 5 ] = 1 - (( mat_best [:,4 ]) / float (mat_dry_dtw .shape [0 ]) )
97
- mat_best [:, 6 ] = mat_best [:,3 ] / (mat_best [:,5 ])
96
+ mat_best [:, 5 ] = mat_best [:,4 ] / float (mat_dry_dtw .shape [0 ])
97
+ mat_best [:, 6 ] = mat_best [:,3 ] / (1 - ( mat_best [:,5 ]) )
98
98
colnames = ['dtw_thresh' , 'hrs_thresh' , 'n_wet' , 'perWet' , 'n_dry' , 'perDry' , 'perRatio' ]
99
- df_all = pd .DataFrame (mat_best , columns = colnames ).sort_values (by = 'perRatio' )
99
+ df_all = pd .DataFrame (mat_best , columns = colnames ).sort_values (by = 'perRatio' , ascending = False )
100
100
101
101
np .save (op .join (self .path_data , 'dtw_hrs_wet_dry.npy' ), mat_best )
102
102
df_all .to_pickle (op .join (self .path_data , 'dtw_hrs_wet_dry.df' ))
103
103
104
- print (df_all .head (10 ))
104
+ ## do some cropping
105
+ df_new = df_all [df_all .hrs_thresh > 7000 ]
106
+ BB .print_all (df_new .head (250 ))
105
107
106
108
return mat_all , df_all
107
109
0 commit comments