investigate-dataset
Skill747 starsChanged 36 days agoMITView on GitHub
Investigate datasets from HuggingFace, CSV, or JSON files to understand their structure, fields, and data quality. Trigger whenever you need to explore or inspect a dataset yourself without using pre-written scripts.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build-repo-contextSkill
- check-trajectories-workflowSkill
- ci-maintenance-workflowSkill
- code-quality-fix-allSkill
- code-quality-review-allSkill
- create-evalSkill
- ensure-test-coverageSkill
- eval-quality-workflowSkill
- eval-report-workflowSkill
- eval-validity-reviewSkill
- generate-asset-actionsSkill
- prepare-releaseSkill
- prepare-submission-workflowSkill
- read-eval-logsSkill
- security-audit-evalSkill
- verify-scoring-changeSkill
- write-an-adrSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Look for these patterns in the evaluation code:
- Distinctive: line 54
Use standard pandas/datasets methods to explore:
- Very specific: line 59
Missing values: Check for None, empty strings, empty lists
- Distinctive: line 60
Duplicates: Check ID uniqueness if an ID field exists
- Very specific: line 67
Look at the record_to_sample function to understand how raw data maps to Inspect samples.
- Very specific: line 96
Gated dataset: Run huggingface-cli login or set HF_TOKEN
- Very specific: line 98
Large dataset: Use streaming=True or split="train[:1000]" for sampling
- Distinctive: line 99
Missing revision: Check the dataset's "Files and versions" tab on HuggingFace
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Investigate Dataset
This workflow helps you explore and understand datasets used in evaluations. It covers HuggingFace datasets, CSV files, and JSON/JSONL files.
Key Concepts
For detailed information on Inspect's dataset types (datasets.Dataset vs inspect_ai.dataset.Dataset), the hf_dataset() pipeline, caching behaviour, and test utilities, see references/inspect-dataset-patterns.md.
Common Patterns in Evals
Evals typically define:
DATASET_PATH: HuggingFace repo path (e.g.,"qiaojin/PubMedQA")DATASET_REVISION: Optional git revision/tag for reproducibilityrecord_to_sample(): Function converting raw records toSampleobjects
Prerequisites
- Access to the evaluation code to find dataset configuration
- Python environment with
datasets,pandas, andinspect_aiinstalled
Steps
1. Identify the Dataset Source
Look for these patterns in the evaluation code:
# HuggingFace dataset
DATASET_PATH = "org/dataset-name"
DATASET_REVISION = "v1.0" # optional
hf_dataset(path=DATASET_PATH, name="subset", split="train", ...)
# CSV dataset
csv_dataset("path/to/file.csv", ...)
load_csv_dataset("https://example.com/file.csv", eval_name="myeval", ...)
# JSON/JSONL dataset
json_dataset("path/to/file.json", ...)
load_json_dataset("https://example.com/file.jsonl", eval_name="myeval", ...)2. Load the Raw Dataset
For investigation, load the raw data directly (not through Inspect's sample_fields transformation). Use standard datasets.load_dataset() for HuggingFace, pd.read_csv() for CSV, or pd.read_json() for JSON/JSONL. For gated datasets, ensure HF_TOKEN is set or run huggingface-cli login.
3. Explore Structure and Quality
Use standard pandas/datasets methods to explore:
- Schema:
ds.features(HF) ordf.dtypes(pandas) - Shape:
len(ds),ds.column_names(HF) ordf.info(),df.columns(pandas) - Sample data:
ds[:3](HF) ordf.head()(pandas) - Missing values: Check for
None, empty strings, empty lists - Duplicates: Check ID uniqueness if an ID field exists
- Value distributions:
value_counts()for categorical columns, length stats for text fields
For converting an Inspect Dataset (which has no .to_pandas()) to a DataFrame, see references/inspect-dataset-patterns.md.
4. Understand the Sample Conversion
Look at the record_to_sample function to understand how raw data maps to Inspect samples. Key questions:
- Which fields become
input? Are they combined/formatted? - What is the
targetformat? (letter, text, JSON, etc.) - Are there
choicesfor multiple choice? - What goes into
metadata? - Are any records filtered out?
5. Test the Inspect Loading Pipeline
See references/inspect-dataset-patterns.md for the pattern to load through Inspect's hf_dataset() and verify sample conversion works correctly.
Quick Reference Commands
# View HF dataset info without downloading
uv run python -c "from datasets import load_dataset_builder; b = load_dataset_builder('org/name'); print(b.info)"
# List available configs/subsets
uv run python -c "from datasets import get_dataset_config_names; print(get_dataset_config_names('org/name'))"
# List available splits
uv run python -c "from datasets import load_dataset; print(load_dataset('org/name', split=None).keys())"Caching and Troubleshooting
For cache locations (HuggingFace native, Inspect AI, Inspect Evals), force re-download commands, and test utilities, see references/inspect-dataset-patterns.md.
- Gated dataset: Run
huggingface-cli loginor setHF_TOKEN - Rate limited: The
hf_datasetwrapper ininspect_evals.utils.huggingfacehas built-in retry with backoff - Large dataset: Use
streaming=Trueorsplit="train[:1000]"for sampling - Missing revision: Check the dataset's "Files and versions" tab on HuggingFace
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

