Ejemplo n.º 1
0
 # initialize variables
 data = None
 tracer = None
 cls_pred = None
 cls_true = None
 directory = None
 #----------------------------------------
 # Loading section
 # load argv
 if len(argv) != 3:
     print("Error!\nUsage: test_tracer.py [directory] [keyword]")
     exit()
 directory = argv[1]
 keyword = argv[2]
 # load tracer
 failure, data, tracer = load_lib.load_arrangement(keyword, directory)
 if not failure:
     print("load data and tracer success")
 # load cls_pred
 failure, cls_pred = load_lib.load_cls_pred(keyword, directory)
 if not failure:
     print("load cls_pred success")
 # load cls_true
 failure, cls_true = load_lib.load_cls_true(keyword, directory)
 if not failure:
     print("load cls_true success")
 failure, coords = load_lib.load_coords(keyword, directory)
 if not failure:
     print("load coords success")
 #----------------------------------------
 # test if the loading is successful or not
Ejemplo n.º 2
0
     print(
         "Error!\nUsage: plot_sed.py [main_name] [ no-observation value ] [true label] [pred label]"
     )
     print("Example: plot_loss_freq.py MaxLoss15 '0.0' 1 2")
     exit()
 main_name = argv[1]
 no_obs = float(argv[2])
 true_label = int(argv[3])
 pred_label = int(argv[4])
 #----------------------------------------
 data_list = glob("AI*test_on*")
 for directory in data_list:
     print("#################################")
     print("start to loading data saved in {0}".format(directory))
     # load tracer
     failure, data, tracer = load_lib.load_arrangement(main_name, directory)
     if not failure:
         print("load data and tracer success")
     # load cls_pred
     failure, cls_pred = load_lib.load_cls_pred(main_name, directory)
     if not failure:
         print("load cls_pred success")
     # load cls_true
     failure, cls_true = load_lib.load_cls_true(main_name, directory)
     if not failure:
         print("load cls_true success")
     # confusion matrix
     print("### confusion matrix ###")
     failure, cm = load_lib.confusion_matrix(cls_true, cls_pred)
     if not failure:
         print("confusion matrix success")