Skip to main content

Preparing Datasets

Format your data correctly before training with ColabHive. This guide covers the supported formats, examples, and the data-volume guidance you should size against.

Supported formats

The canonical dataset storage formats are: csv, jsonl, parquet, and hf_dataset (reference an existing HuggingFace dataset). When you upload a file, the format is detected from its extension:

ExtensionStored as
.csvcsv
.jsonl or .jsonjsonl
.parquetparquet
  • Files under 100 MB: use client.datasets.upload() directly.
  • Files over 100 MB: use the multipart upload flow.

Tabular data (regression & classification)

Use CSV, JSONL, or Parquet for XGBoost, LightGBM, Random Forest, CatBoost, SVM, MLP, TabNet, and BERT classification.

Simple, human-readable. Column headers on the first row.

age,income,loan_amount,credit_score,approved
35,55000,10000,720,1
42,80000,25000,680,1
28,30000,5000,580,0

Rules:

  • First row must be column headers.
  • Feature columns: any numeric or text values.
  • Target column: the column to predict (specify in hyperparameters).
  • Missing values: leave blank — ColabHive handles them automatically.
  • Minimum row counts vary by model — see Data volume guidance.

JSONL (JSON Lines)

One JSON object per line. Good for mixed types and nested structures.

{"age": 35, "income": 55000, "loan_amount": 10000, "credit_score": 720, "approved": 1}
{"age": 42, "income": 80000, "loan_amount": 25000, "credit_score": 680, "approved": 1}
{"age": 28, "income": 30000, "loan_amount": 5000, "credit_score": 580, "approved": 0}

Parquet

Columnar format. Best for large datasets (millions of rows) thanks to compression and fast reads.

import pandas as pd

df = pd.read_csv("data.csv")
df.to_parquet("data.parquet", index=False)

Specifying the target column

By default, ColabHive uses the last column as the target. Override it:

job = client.training.create(
model="xgboost-regression",
dataset_id=dataset.id,
hyperparameters={
"target_column": "approved", # specify explicitly
"n_estimators": 100,
},
)

Multi-output regression

XGBoost, LightGBM, Random Forest, MLP, and TabNet support predicting multiple target columns in a single run:

hyperparameters = {
"target_columns": ["temp", "humidity", "pressure"], # multiple targets
}

LLM fine-tuning datasets

For llm-qlora-finetune (transformers + PEFT backend). The format depends on the dataset_type hyperparameter. Full parameter reference: LLM Fine-Tuning.

Best for instruction-following and Q&A. Loss is computed only on output.

{"instruction": "Write a Python function to reverse a string", "input": "", "output": "def reverse_string(s):\n    return s[::-1]"}
{"instruction": "What is the capital of France?", "input": "", "output": "Paris"}
  • instruction (required), input (optional context), output (required).

Chat (dataset_type: "chat") — multi-turn / ChatML

messages ([{role, content}]) or sharegpt-style conversations ([{from, value}]), rendered with the tokenizer's chat template.

{"messages": [{"role": "user", "content": "Hello, how are you?"}, {"role": "assistant", "content": "Doing great, thanks!"}]}
{"messages": [{"role": "system", "content": "You are a coding assistant."}, {"role": "user", "content": "What is a closure?"}, {"role": "assistant", "content": "A closure captures variables from its enclosing scope..."}]}

Text (dataset_type: "text") — raw completion

A single free-text column (defaults to text; override with text_column).

{"text": "The quick brown fox jumps over the lazy dog. This is an example of a pangram."}
{"text": "Machine learning is a subset of AI that enables computers to learn from data."}

Time series datasets

For timesfm-2.5-finetune-gpu, prophet-forecasting, arima-forecasting, classical-forecasting-auto, and the other forecasters.

A CSV with a date/timestamp column and one or more numeric target columns:

date,sales,temperature
2023-01-01,1200,22.5
2023-01-02,1350,23.1
2023-01-03,1100,21.8

Requirements:

  • Date column consistently formatted (YYYY-MM-DD recommended).
  • Regular intervals (daily, weekly, monthly — no gaps).
  • Target column(s) numeric.
  • Length: at least 24 points for ARIMA; more for Prophet and TimesFM (see Data volume guidance).
hyperparameters = {
"date_column": "date",
"target_column": "sales", # single target
# or:
"target_columns": ["sales", "temperature"], # multi-target
}

Text classification datasets (BERT)

For bert-classification-gpu:

text,label
"This movie was absolutely fantastic!",positive
"Terrible service, never going back.",negative
"Average experience, nothing special.",neutral
  • text: the text to classify (any length).
  • label: the class label (string or integer).
  • At least 100 samples per class (see Data volume guidance).

Best practices

  • No duplicate rows. Remove exact duplicates before uploading.
  • Consistent missing values. Empty strings for CSV, null for JSONL — don't mix "N/A", 0, -999.
  • Balanced classes (classification). Extreme imbalance (>10:1) hurts performance.
  • No target leakage. Don't include columns derived from or trivially correlated with the target.

Data volume guidance

These are the single reference minimums for this guide. They are guidance for good results, not hard limits enforced by the API.

Model familyMinimumSweet spot
Linear / Logistic Regression100 rows500 – 10,000
Random Forest200 rows1,000 – 100,000
XGBoost / LightGBM500 rows10,000 – 1,000,000
MLP / TabNet1,000 rows100,000+
BERT classification100 / class1,000 – 50,000
LLM fine-tuning (alpaca)500 rows2,000 – 10,000
LLM fine-tuning (chat)200 rows1,000 – 5,000
LLM domain fine-tuning1,000 rows5,000 – 50,000
Time series (ARIMA)24 points100 – 10,000
Time series (Prophet)50 points100 – 10,000
Time series (TimesFM)100 points500 – 10,000

See also