def load(self, sod_file, s): print "Loading sod catalog:", s fname = sod_file.replace("${num}", str(s)) self.core_steps.append(s) htags = dtk.gio_read(fname, "fof_halo_tag") radius = dtk.gio_read(fname, "sod_radius") mass = dtk.gio_read(fname, "sod_mass") indx = np.arg_sort(htags) self.htag.append(htags[indx]) self.sod_mass.append(mass[indx]) self.sod_radius.append(radius[indx])
def feature_importance(model, threshold=0.05): feature = model.feature_importance indx = np.arg_sort(feature)[::-1] feature_norm = feature[indx]/feature[indx[0]] return indx[feature_norm>=threshold]
def feature_importance(model): feature = model.feature_importance np.arg_sort(feature)