hung-phan/ml-skills/data
Claude Code and agent skill by hung-phan/ml-skills
- community
Checking that the SKILL.md file is still in the repository.
Streaming distributed dataset processing for ML pipelines. Covers read/write, map_batches with UDFs, tokenization, image transforms, and integration with Ray Train. Use when preprocessing data too large for memory, building ETL for training, or need distributed tokenization/transforms.
Install
npx vskill@latest install hung-phan/ml-skills/dataSKILL.md
The same SKILL.md was published earlier as hung-phan/ml-skills/data.
Ray Data
- Docs: https://docs.ray.io/en/latest/data/data.html
- API: https://docs.ray.io/en/latest/data/api/dataset.html
- Key design: Streaming block-by-block execution, never materializes full dataset
Why This Exists
Problem: ML datasets (tokenization corpora, image archives, parquet shards) are often larger than RAM; pandas and HuggingFace datasets load eagerly and choke on multi-TB data, while custom multiprocessing pipelines are brittle and don't integrate with distributed trainers.
Key insight: Ray Data streams data block-by-block through a pipeline of transforms, so memory usage stays bounded regardless of dataset size, and the same pipeline feeds directly into Ray Train workers without extra serialization.
Reach for this when: You need to preprocess or tokenize datasets too large for memory, apply GPU-accelerated transforms at scale (e.g., image augmentation), or pipe data into a distributed Ray Train job — prefer it over pandas/HuggingFace datasets once data exceeds a single node's RAM.
Reading Data
Core Operations
map_batches (The Main Tool)
Key Parameters
| Param | Default | Purpose | |
|---|---|---|---|
batch_size | None | Rows per batch; None uses whole blocks. Docs recommend "auto" or an explicit size (e.g. 1024) | |
concurrency | auto | Parallel workers | |
num_gpus | 0 | GPU per worker (for GPU transforms) | |
batch_format | "default" | "numpy", "pandas", "pyarrow" |
Streaming into Training
Integration with Ray Train
Image Preprocessing
Performance Tips
| Tip | Why | |
|---|---|---|
| Use class UDFs for expensive init (model loading) | Init runs once per worker, not per batch | |
Set concurrency explicitly | Auto-detection can over/under-provision | |
Large batch_size for GPU transforms | Amortize kernel launch overhead | |
prefetch_batches=4 in iter_batches | Overlap I/O with compute | |
Avoid random_shuffle() on large data | Materializes entire dataset; use per-epoch shuffle in trainer |
References
- Official docs: https://docs.ray.io/en/latest/data/data.html
- Loading data guide: https://docs.ray.io/en/latest/data/loading-data.html
- GitHub: https://github.com/ray-project/ray
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ml-review/references/ml-libraries/ray/data/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hung-phan/ml-skills/data)