[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KH1F02SDPYNQRCPC9D0KPR":3,"skill-same:01M6KH1F02SDPYNQRCPC9D0KPR":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":41,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":43,"install":44,"resources":57},"01M6KH1F02SDPYNQRCPC9D0KPR","parallel-grid-search-python",null,"How to parallelize a grid search over hyperparameter combinations in Python using joblib or multiprocessing for CPU-bound tasks like DBSCAN clustering.","cxcscmu\u002FSkillLearnBench","cxcscmu","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142838272?v=4","01M6KCQDFQWPDSN0MKZY96MSQP","01M6KCQDM7G70TKJ28NTSQC0RZ",92,"MIT","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb3-teacher-feedback-claude-opus-4-6\u002Fdbscan-parameter-tuning\u002Frun1_parallel-grid-search-python\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30],"python","search","parallel","grid","parallel grid search","parallel grid search python","tasks","clustering","how","combinations","how to","CPU","for","2026-11-10 10:12:30",false,"---\nname: parallel-grid-search-python\ndescription: How to parallelize a grid search over hyperparameter combinations in Python using joblib or multiprocessing for CPU-bound tasks like DBSCAN clustering.\n---\n\n## Parallel Grid Search in Python\n\n### Grid Construction\n\n```python\nimport itertools\nimport numpy as np\n\nmin_samples_range = list(range(3, 10))           # 3-9: 7 values\nepsilon_range = list(range(4, 25, 2))              # 4-24 step 2: 11 values\nshape_weight_range = [round(0.9 + 0.1*i, 1) for i in range(11)]  # 0.9-1.9: 11 values\n\nall_combos = list(itertools.product(min_samples_range, epsilon_range, shape_weight_range))\n# Total: 7 * 11 * 11 = 847 combinations\n```\n\n### Using joblib for Parallelization\n\n```python\nfrom joblib import Parallel, delayed\n\ndef evaluate_params(min_samples, epsilon, shape_weight, citsci_df, expert_df):\n    \"\"\"Evaluate one hyperparameter combination across all images.\"\"\"\n    # ... run DBSCAN for each image, compute F1 and delta ...\n    return {\n        'min_samples': min_samples,\n        'epsilon': epsilon,\n        'shape_weight': shape_weight,\n        'F1': avg_f1,\n        'delta': avg_delta\n    }\n\nresults = Parallel(n_jobs=-1, verbose=10)(\n    delayed(evaluate_params)(ms, eps, sw, citsci_df, expert_df)\n    for ms, eps, sw in all_combos\n)\n```\n\n### Performance Tips\n\n1. **Precompute per-image data**: Group citizen science points by `file_rad` once, outside the loop\n2. **Use precomputed distance matrices**: For each image's points, compute the distance matrix inside the evaluation\n3. **Avoid passing large DataFrames**: Instead, pass pre-grouped dictionaries\n4. **n_jobs=-1**: Uses all available CPU cores\n\n```python\n# Pre-group data for efficiency\ncitsci_grouped = {}\nfor file_rad, group in citsci_df.groupby('file_rad'):\n    citsci_grouped[file_rad] = group[['x', 'y']].values\n\nexpert_grouped = {}\nfor file_rad, group in expert_df.groupby('file_rad'):\n    expert_grouped[file_rad] = group[['x', 'y']].values\n\nunique_images = list(expert_grouped.keys())  # Loop over expert images\n```\n\n### Memory Considerations\n- With 847 combinations and many images, memory can be an issue\n- Distance matrices are O(n²) per image — but citizen science annotations per image are typically small\n- Consider batching if memory is tight","## Parallel Grid Search in Python\n\n### Grid Construction\n\n```python\nimport itertools\nimport numpy as np\n\nmin_samples_range = list(range(3, 10))           # 3-9: 7 values\nepsilon_range = list(range(4, 25, 2))              # 4-24 step 2: 11 values\nshape_weight_range = [round(0.9 + 0.1*i, 1) for i in range(11)]  # 0.9-1.9: 11 values\n\nall_combos = list(itertools.product(min_samples_range, epsilon_range, shape_weight_range))\n# Total: 7 * 11 * 11 = 847 combinations\n```\n\n### Using joblib for Parallelization\n\n```python\nfrom joblib import Parallel, delayed\n\ndef evaluate_params(min_samples, epsilon, shape_weight, citsci_df, expert_df):\n    \"\"\"Evaluate one hyperparameter combination across all images.\"\"\"\n    # ... run DBSCAN for each image, compute F1 and delta ...\n    return {\n        'min_samples': min_samples,\n        'epsilon': epsilon,\n        'shape_weight': shape_weight,\n        'F1': avg_f1,\n        'delta': avg_delta\n    }\n\nresults = Parallel(n_jobs=-1, verbose=10)(\n    delayed(evaluate_params)(ms, eps, sw, citsci_df, expert_df)\n    for ms, eps, sw in all_combos\n)\n```\n\n### Performance Tips\n\n1. **Precompute per-image data**: Group citizen science points by `file_rad` once, outside the loop\n2. **Use precomputed distance matrices**: For each image's points, compute the distance matrix inside the evaluation\n3. **Avoid passing large DataFrames**: Instead, pass pre-grouped dictionaries\n4. **n_jobs=-1**: Uses all available CPU cores\n\n```python\n# Pre-group data for efficiency\ncitsci_grouped = {}\nfor file_rad, group in citsci_df.groupby('file_rad'):\n    citsci_grouped[file_rad] = group[['x', 'y']].values\n\nexpert_grouped = {}\nfor file_rad, group in expert_df.groupby('file_rad'):\n    expert_grouped[file_rad] = group[['x', 'y']].values\n\nunique_images = list(expert_grouped.keys())  # Loop over expert images\n```\n\n### Memory Considerations\n- With 847 combinations and many images, memory can be an issue\n- Distance matrices are O(n²) per image — but citizen science annotations per image are typically small\n- Consider batching if memory is tight",{"name":5,"description":7},"main","726e1f79b96b0cb3d729d0e55a1c847e0b5353ae","skills\u002Fb3-teacher-feedback-claude-opus-4-6\u002Fdbscan-parameter-tuning\u002Frun1_parallel-grid-search-python",7,"https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench","https:\u002F\u002Fcxcscmu.github.io\u002FSkillLearnBench","https:\u002F\u002Fgithub.com\u002Fcxcscmu","2026-10-02 22:55:36",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add cxcscmu\u002FSkillLearnBench --skill parallel-grid-search-python",{"tool":50,"command":51},"bunx","bunx skills add cxcscmu\u002FSkillLearnBench --skill parallel-grid-search-python",{"tool":53,"command":54},"pnpm","pnpm dlx skills add cxcscmu\u002FSkillLearnBench --skill parallel-grid-search-python","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb3-teacher-feedback-claude-opus-4-6\u002Fdbscan-parameter-tuning\u002Frun1_parallel-grid-search-python\u002FSKILL.md",true,[],[59,77,101,118,137,149],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":70,"publishedAt":31},"01M6KM5KH175P5ABP5JMX2SBDQ","object_counter","Count occurrences of an object in the image using computer vision algorithm.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Fvideo-object-counting\u002Fobject_counter\u002FSKILL.md",[65],{"categoryNo":66,"categoryName":67,"taxonomyType":68,"taxonomyTypeDesc":69},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[71,72,73,74,75,76],"object counter","object","vision","computer","Computer Vision","image",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":86,"publishedAt":31},"01M6KM51TMVXG79MMPCS6Y8G86","travel-planning-workflow","Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Ftravel-planning-workflow\u002FSKILL.md",[83],{"categoryNo":84,"categoryName":85,"taxonomyType":68,"taxonomyTypeDesc":69},"01JBSEEDCAT000000000000023","Skill与智能体开发",[87,88,89,90,91,92,93,94,95,30,96,97,98,99,100],"workflow","planning","planning workflow","travel","travel planning","travel planning workflow","structured","performing","plan","user","it","requirements","essential","itineraries",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":31},"01M6KM4DY820XHS9YTSK5QP5HD","bundled-dataset-search-tool","invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Fbundled-dataset-search-tool\u002FSKILL.md",[],[19,108,109,110,111,112,113,90,114,115,91,116,30,117,88],"tool","dataset","bundled dataset search tool","restaurants","Tools","up","look","flights","you","database",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":31},"01M6KM465BB9PQ0B548HQSVAWZ","glm-output","Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final \u002Froot\u002Fmetrics.json.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-output\u002FSKILL.md",[],[125,126,127,30,24,128,129,130,131,132,133,134,116,135,136],"glm output","output","glm","metrics","json","basics","guidance","matching","verifier","processing","root","calibration",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":144,"publishedAt":31},"01M6KM40KY3QWDW5W97S39R2BC","glm-calibration","Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-calibration\u002FSKILL.md",[143],{"categoryNo":84,"categoryName":85,"taxonomyType":68,"taxonomyTypeDesc":69},[145,136,127,126,131,130,24,146,147,30,148],"glm calibration","setup","companion","metric",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":31},"01M6KM3VHHVSGMGHJQB3PPT6YG","glm-basics","A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-basics\u002FSKILL.md",[],[156,127,130,157,145,136,30,126,158,159,160,161,26,162,24],"glm basics","inspect","relevant","files","good","use","Evaluation"]