{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-protocol-design-hypogenic-7b48d383f963","title":"Automated Hypothesis Generation for Tabular Data","summary":"Generate and evaluate testable hypotheses from tabular datasets using LLM-driven analysis. The output includes a JSON file of hypotheses and their evaluation results on validation\/test splits.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-protocol-design-hypogenic-7b48d383f963","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-protocol-design-hypogenic-7b48d383f963","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-protocol-design-hypogenic-7b48d383f963.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-protocol-design-hypogenic-7b48d383f963\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Install `hypogenic` via PyPI (e.g., `uv pip install hypogenic`). Prepare a HuggingFace-style JSON dataset with training, validation, and test splits. Create a YAML config file with prompt templates and dataset paths. Optional dependencies like Redis, GROBID, and s2orc-doc2json are recommended for performance or literature integration.","instructions":"---\nname: hypogenic\ndescription: Automated LLM-driven hypothesis generation and testing for tabular datasets; use when you need systematic exploration of empirical patterns (e.g., fraud detection, content analysis) and want to combine literature insights with data-driven hypothesis evaluation.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n## When to Use\n\n- **Exploratory analysis on a new dataset** where you want the model to propose multiple *testable* hypotheses from observed patterns (e.g., AI-generated text detection).\n- **Benchmarking competing explanations** by generating a hypothesis bank and evaluating them consistently on validation\/test splits.\n- **Literature-informed research** where you want to extract claims from papers and refine them against real data (e.g., deception cues in reviews).\n- **High-coverage hypothesis discovery** when you need both theory-driven and data-driven hypotheses, then merge\/deduplicate them (Union workflows).\n- **Hypothesis-driven classification\/regression pipelines** for domains like fraud detection, content moderation, mental health indicators, or other empirical studies using tabular\/JSON datasets.\n\n## Key Features\n\n- **Automated hypothesis generation (HypoGeniC)**: iteratively proposes and improves hypotheses using dataset feedback.\n- **Literature + data integration (HypoRefine)**: extracts literature insights from PDFs and refines hypotheses jointly with empirical signals.\n- **Union method**: mechanically merges literature-only hypotheses with HypoGeniC\/HypoRefine outputs to maximize coverage and reduce redundancy.\n- **Config-driven prompting**: YAML templates with variable injection (e.g., `${text_features_1}`, `${num_hypotheses}`) for generation and inference.\n- **Scalable experimentation**: optional Redis caching, parallelism, and adaptive selection focusing on hard examples.\n\n## Dependencies\n\n- `hypogenic` (install via PyPI; version depends on your environment)\n- Optional (recommended for cost\/performance):\n  - `redis` (server; used for caching repeated LLM calls)\n- Optional (required for literature\/PDF workflows such as HypoRefine):\n  - `GROBID` (service; used for PDF preprocessing)\n  - `s2orc-doc2json` (PDF-to-structured conversion used in literature pipelines)\n\nInstall:\n```bash\nuv pip install hypogenic\n```\n\n## Example Usage\n\nThe following example is a minimal end-to-end workflow (dataset + config + CLI + Python). Adjust paths and prompts for your task.\n\n### 1) Prepare a dataset (HuggingFace-style JSON)\n\nCreate three files:\n\n- `.\/data\/my_task_train.json`\n- `.\/data\/my_task_val.json`\n- `.\/data\/my_task_test.json`\n\nExample schema (feature keys can be renamed, but must match your config placeholders):\n```json\n{\n  \"text_features_1\": [\"Text A1\", \"Text A2\"],\n  \"text_features_2\": [\"Text B1\", \"Text B2\"],\n  \"label\": [\"Class1\", \"Class2\"]\n}\n```\n\n### 2) Create `.\/data\/my_task\/config.yaml`\n\n```yaml\ntask_name: my_task\n\ntrain_data_path: .\/data\/my_task_train.json\nval_data_path: .\/data\/my_task_val.json\ntest_data_path: .\/data\/my_task_test.json\n\nprompt_templates:\n  observations: |\n    Feature 1: ${text_features_1}\n    Feature 2: ${text_features_2}\n    Label: ${label}\n\n  batched_generation:\n    system: |\n      You are a scientific assistant. Propose testable, falsifiable hypotheses that map features to labels.\n    user: |\n      Given examples and labels, generate ${num_hypotheses} distinct hypotheses.\n      Return a JSON list of hypotheses, each with a short name and a testable statement.\n\n  inference:\n    system: |\n      You are a careful classifier. Use the provided hypothesis to predict the label.\n    user: |\n      Hypothesis: ${hypothesis}\n      Feature 1: ${text_features_1}\n      Feature 2: ${text_features_2}\n      Output the final answer as: \"final answer: <LABEL>\"\n```\n\n### 3) Run generation + inference (CLI)\n\n```bash\n# Generate hypotheses (HypoGeniC)\nhypogenic_generation \\\n  --config .\/data\/my_task\/config.yaml \\\n  --method hypogenic \\\n  --num_hypotheses 20\n\n# Evaluate generated hypotheses\nhypogenic_inference \\\n  --config .\/data\/my_task\/config.yaml \\\n  --hypotheses .\/output\/hypotheses.json\n```\n\n### 4) Run the same workflow (Python API)\n\n```python\nfrom hypogenic import BaseTask\nimport re\n\ndef extract_label(llm_output: str) -> str:\n    m = re.search(r\"final answer:\\s*(.*)\", llm_output, re.IGNORECASE)\n    return m.group(1).strip() if m else llm_output.strip()\n\ntask = BaseTask(\n    config_path=\".\/data\/my_task\/config.yaml\",\n    extract_label=extract_label,\n)\n\ntask.generate_hypotheses(\n    method=\"hypogenic\",\n    num_hypotheses=20,\n    output_path=\".\/output\/hypotheses.json\",\n)\n\nresults = task.inference(\n    hypothesis_bank=\".\/output\/hypotheses.json\",\n    test_data=\".\/data\/my_task_test.json\",\n)\n\nprint(results)\n```\n\n## Implementation Details\n\n### Methods\n\n- **HypoGeniC (data-driven)**\n  - Initializes hypotheses from a subset of training data.\n  - Iteratively evaluates hypotheses on validation data and replaces underperforming ones.\n  - Often uses *hard\/challenging samples* to prompt improved hypotheses.\n\n- **HypoRefine (literature + data)**\n  - Preprocesses PDFs into structured text (commonly via GROBID + conversion tooling).\n  - Generates a literature-derived hypothesis bank and a data-derived hypothesis bank.\n  - Refines both banks iteratively using performance feedback and relevance checks.\n\n- **Union**\n  - Produces combined banks such as:\n    - `Literature \u222a HypoGeniC`\n    - `Literature \u222a HypoRefine`\n  - Focuses on coverage and deduplication rather than deeper joint optimization.\n\n### Configuration and Prompt Parameters\n\n- **Variable injection**: prompt templates can reference dataset fields and runtime parameters:\n  - `${text_features_1}`, `${text_features_2}`, \u2026 (from dataset JSON)\n  - `${label}` (ground truth label, typically used in observation templates)\n  - `${num_hypotheses}` (generation-time control)\n  - `${hypothesis}` (inference-time hypothesis text)\n- **Label parsing (`extract_label`)**:\n  - Accuracy depends on extracting a label string that *exactly matches* the dataset\u2019s `label` values.\n  - Default patterns often look for `final answer: ...`; customize for your output format.\n\n### Performance\/Cost Controls (Optional)\n\n- **Redis caching**: reduces repeated LLM calls during iterative generation and evaluation.\n- **Parallelism**: speeds up hypothesis testing on large datasets.\n- **Adaptive selection**: prioritizes difficult examples to improve hypothesis quality over iterations.","use_cases":["Exploratory analysis on a new dataset to propose multiple testable hypotheses from observed patterns.","Benchmarking competing explanations by generating a hypothesis bank and evaluating them consistently on validation\/test splits."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Protocol%20Design\/hypogenic\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-26","created_at":"2026-11-24T16:38:08.000000Z","updated_at":"2026-11-26T09:25:15.000000Z","seo_title":"Automated Hypothesis Generation for Tabular Data","seo_description":"Generate and evaluate testable hypotheses from tabular datasets using LLM-driven analysis for exploratory data analysis.","seo_keywords":["hypothesis generation for tabular data","LLM-driven hypothesis testing","automated exploratory data analysis","data-driven hypothesis evaluation"]}}