예제 #1
0
import seaborn as sns
import scipy.stats as sst

from flowcat import utils, io_functions

NAME = "result_analysis_removeedge"

RESULTS = {
    "path": utils.URLPath("output"),
    "names": ["classifier_ungated", "classifier_gated_removeedge"],
}

OUTPUT = utils.URLPath(f"output/{NAME}")

LOGGER = utils.setup_logging(utils.URLPath(f"logs/{NAME}_{utils.create_stamp()}"), NAME)

def get_result_dirs(path: utils.URLPath, names: list):
    """Get result directories for individual iterations from given path and names"""
    result_dirs = {
        name: Metrics(list(map(Result, path.glob(f"./{name}*")))) for name in names
    }
    return result_dirs


@dataclass
class Result:
    path: utils.URLPath

    @property
    def json_results(self):
예제 #2
0
    LOGGER.info("Tube 1 %s", sample)
    data = sample.get_data()
    LOGGER.info(data)
    LOGGER.info(
        f"{data.data.shape}, {data.data.min(axis=1)}, {data.data.max(axis=1)}")


SEED = None
OUTPUT = utils.URLPath(f"output/{NAME}")
LOGDIR = utils.URLPath(f"logs/{NAME}_{utils.create_stamp()}")
INPUT = {
    "data": utils.URLPath("output/ungated/data"),
    "meta": utils.URLPath("output/samples/meta.json.gz"),
}

LOGGER = utils.setup_logging(LOGDIR, NAME)

set_seed(SEED)
dataset = io_functions.load_case_collection(INPUT["data"], INPUT["meta"])

check_dataset(dataset)

train, test = dataset.create_split(0.9)
io_functions.save_json(train.labels, OUTPUT / "train_ids.json")
io_functions.save_json(test.labels, OUTPUT / "test_ids.json")

reference = train.sample(1)
LOGGER.info("Reference dataset: %s", reference)
LOGGER.info("Reference labels: %s", reference.labels)

model = flowcat.FlowCat()