random_sampler

Generate random samples from JSONL files by count or ratio.

541|171|Updated May 3, 2018
One-click install
npx skills add https://github.com/cas-bigdatalab/piflow --skill random-sampler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: random_sampler
Source: https://github.com/cas-bigdatalab/piflow/tree/main/workspace/skills/random_sampler
Command: npx skills add https://github.com/cas-bigdatalab/piflow --skill random-sampler

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

The random_sampler skill simplifies the task of sampling JSONL data, providing the ability to randomly select a subset of data with configurable count or ratio.

Core Features & Use Cases

  • Random Sampling: Perform non-parametric random sampling of JSONL files.
  • Count-Based Sampling: Select a specified number of samples.
  • Ratio-Based Sampling: Select a percentage of samples.
  • Use Case: Useful for creating random test datasets from large JSONL files for validation and training machine learning models.

Quick Start

Use the random_sampler skill with --method count --count 50 --seed 123 to randomly select 50 records from a JSONL file with a random seed of 123.

Frequently Asked Questions about random_sampler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a random data subset from a large JSONL file?

You can perform random sampling on a JSONL file by specifying a desired count or ratio, which generates a representative data subset suitable for creating test datasets or training machine learning models.

Can I select a specific number of records instead of a percentage during data sampling?

Yes, data sampling supports count-based selection, allowing you to specify an exact number of records to randomly select from your JSONL file rather than relying solely on a ratio-based percentage.

How do I ensure reproducible results when extracting a random sample from JSONL data?

You can ensure reproducible random sampling results by configuring a specific random seed, such as setting the seed parameter to a fixed integer, which guarantees the same records are selected across multiple runs.

Does this random sampling approach support stratified data selection?

No, this approach performs non-parametric random selection without the need for stratification, meaning it does not group data into distinct strata before sampling your JSONL records.

What is the best way to create a random test dataset for machine learning validation?

The best way to create a random test dataset is to apply non-parametric random sampling to your source JSONL file, extracting a representative data subset configured by either a fixed count or a specified ratio.