Parallel grid search
Efficiently perform hyperparameter grid search using parallel processing.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill parallel-grid-searchAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.1 KB, 241 tokens by cl100k_base, as published. Nobody here has run it
Parallel Grid Search
Parallelizing grid searches can significantly reduce computation time, especially for independent trials.
Using joblib
joblib is a popular library for parallelizing Python loops.
from joblib import Parallel, delayed
import itertools
def run_experiment(params):
min_samples, epsilon, shape_weight = params
# ... logic to run DBSCAN and evaluate ...
return results
# Define search space
min_samples_range = range(3, 10)
epsilon_range = range(4, 26, 2)
shape_weight_range = [round(x * 0.1, 1) for x in range(9, 20)]
param_combinations = list(itertools.product(min_samples_range, epsilon_range, shape_weight_range))
# Run in parallel
results = Parallel(n_jobs=-1)(delayed(run_experiment)(p) for p in param_combinations)
Considerations
- Data Sharing: Pass only necessary data to workers to minimize overhead.
- Progress Tracking: Use
tqdmif a progress bar is needed. - Resource Management: Be mindful of memory usage when running many parallel processes.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.