Skip to content

Instantly share code, notes, and snippets.

@heymarco
heymarco / ml_experiment_logging.py
Last active December 8, 2022 09:49
A handy class for logging machine learning experiments with minimal example
import time
import pandas as pd
import numpy as np
# Define column names
REP = "rep"
ROUND = "round"
APPROACH = "Approach"
@heymarco
heymarco / parallel.py
Last active July 11, 2023 14:06
Asynchronous execution of python function with ordered result
from multiprocessing import Pool
from time import sleep
def _wait(i):
sleep(i)
return i
def run_async(function, args_list, njobs, sleep_time_s = 0.01):