Skip to main content

Hyperparameter Tuning

Reference for all configurable hyperparameters per model family, with defaults, ranges, and tuning strategies.

Tip: Use GET /training/model-configs/{model_id}/schema to get the live JSON Schema for any model's hyperparameters — always up to date.


Tree-Based Models (XGBoost, LightGBM, CatBoost, Random Forest)

XGBoost Regression / Classification

Model IDs: xgboost-regression, xgboost-regression-gpu, xgboost-classification

ParameterDefaultRangeNotes
n_estimators10050-5000Number of trees. More = better but slower
max_depth63-12Tree depth. Higher = more complex patterns, more overfitting risk
learning_rate0.10.01-0.5Step size. Lower LR + more trees = better generalization
subsample0.80.5-1.0Fraction of samples per tree. Reduces overfitting
colsample_bytree0.80.5-1.0Fraction of features per tree
reg_alpha00-10L1 regularization. Higher = sparser models
reg_lambda10-10L2 regularization
target_columnlast columnName of the column to predict

Quick presets:

# Small dataset (<10k) — more regularization
hyperparameters={
"n_estimators": 200,
"max_depth": 4,
"learning_rate": 0.05,
"subsample": 0.8,
"reg_alpha": 0.1,
"reg_lambda": 1.0,
}

# Large dataset (>100k) — more trees
hyperparameters={
"n_estimators": 1000,
"max_depth": 6,
"learning_rate": 0.05,
"subsample": 0.8,
}

LightGBM Regression / Classification

Model IDs: lightgbm-regression-gpu, lightgbm-classification

ParameterDefaultRangeNotes
n_estimators300100-5000Number of boosting rounds
num_leaves6320-300Max leaves per tree (key LightGBM param)
max_depth-1-1 (unlimited) to 20-1 means controlled by num_leaves
learning_rate0.050.01-0.3
min_child_samples205-100Min samples per leaf. Higher = smoother model
subsample0.80.5-1.0
colsample_bytree0.80.5-1.0
target_columnlast column

Key difference vs XGBoost: Use num_leaves instead of max_depth. Start with num_leaves=63 and tune from there.


Random Forest Regression / Classification

Model IDs: random-forest-regression, random-forest-classification

ParameterDefaultRangeNotes
n_estimators10050-1000Number of trees
max_depthnullnull (unlimited) or 5-30null = fully grown trees
min_samples_split22-20Min samples to split a node
min_samples_leaf11-10Min samples at leaf
max_features"sqrt""sqrt", "log2", floatFeatures per split
target_columnlast column

CatBoost Regression / Classification

Model IDs: catboost-regression, catboost-classification

ParameterDefaultRangeNotes
iterations500100-5000Number of trees (like n_estimators)
depth64-10Tree depth
learning_rate0.030.01-0.3
l2_leaf_reg31-10L2 regularization
target_columnlast column

CatBoost handles categorical features natively — no need to encode string columns before training.


Linear & Logistic Regression

Model IDs: linear-regression, logistic-regression

ParameterDefaultOptionsNotes
regularization"ridge""ridge", "lasso", "elasticnet", "none"Type of regularization
alpha1.00.001-100Regularization strength. Higher = stronger
l1_ratio0.50-1ElasticNet mix (0=Ridge, 1=Lasso)
target_columnlast column

SVM / SVR

Model IDs: svm-classification, svr-regression

ParameterDefaultOptionsNotes
kernel"rbf""rbf", "linear", "poly"Kernel type
C1.00.01-1000Regularization. Higher = less regularized
gamma"scale""scale", "auto", floatKernel coefficient
target_columnlast column

SVM is slow on large datasets (>50k rows). Prefer XGBoost or LightGBM for larger data.


Deep Learning (MLP, TabNet)

MLP (Multi-Layer Perceptron)

Model ID: mlp-tabular-gpu

ParameterDefaultRangeNotes
hidden_dims[256, 128, 64]List of intsLayer sizes
learning_rate0.0010.0001-0.01Adam LR
batch_size25664-4096Training batch size
epochs5010-500Training epochs
dropout0.10-0.5Dropout rate
target_columnlast column

TabNet

Model ID: tabnet-tabular-gpu

ParameterDefaultRangeNotes
n_steps31-10Number of sequential attention steps
n_a648-256Attention embedding dimension
learning_rate0.020.001-0.1
batch_size1024256-16384
epochs20050-1000
target_columnlast column

NLP (BERT Classification)

Model ID: bert-classification-gpu

ParameterDefaultRangeNotes
epochs52-20Fine-tuning epochs
batch_size328-128Reduce if OOM errors
learning_rate2e-51e-6 to 5e-5Typical BERT range
max_length51264-512Max token length per sample
text_column"text"Column with text data
label_columnlast columnColumn with class labels

LLM Fine-Tuning (llm-qlora-finetune)

Model ID: llm-qlora-finetune

See the LLM Fine-Tuning Guide for a full walkthrough.

ParameterDefaultOptions / RangeNotes
base_modelQwen/Qwen2.5-Coder-7B-InstructAny compatible HF CausalLMHuggingFace repo ID
adapter"qlora""qlora", "lora", "none"none = full fine-tune (needs more VRAM)
epochs31-10
learning_rate0.00021e-5 to 5e-4Typical LoRA range
lora_r164-128LoRA rank. Higher = more parameters
lora_alpha328-256Usually lora_r * 2
lora_dropout0.050-0.2
sequence_len8192512-32768Max token length. Longer = more VRAM (capped to 6144 on Intel XPU)
micro_batch_size1limited by VRAMPer-device batch size. H100: 7B QLoRA @8192 fits mb=8
gradient_accumulation_steps41-32Effective batch = micro * accum
dataset_type"alpaca""alpaca", "chat", "text"
val_set_size0.00-0.99Eval split; reports eval_loss/eval_perplexity
lr_scheduler"cosine""cosine", "constant"With warmup_ratio (default 0.03)
save_stepsauto≥1Checkpoint cadence (resume-able jobs)
flash_attention"auto""auto", "on", "off"Falls back to SDPA if not in image
group_by_lengthtrueboolLength-bucketed batches → less padding

Full parameter reference (optimizer, gradient_checkpointing, sample_packing, pad_to_sequence_len, tokenizer_cache, seed, max_grad_norm, text_column…) in the LLM Fine-Tuning Guide.

VRAM optimization tips:

  • On big cards, raise micro_batch_size before adding accumulation — it's the main throughput lever
  • Reduce micro_batch_size first (then sequence_len) if running out of VRAM
  • qlora uses 4-bit quantization — much less VRAM than lora or none

Time Series

TimesFM 2.5

Model ID: timesfm-2.5-finetune-gpu

ParameterDefaultRangeNotes
date_column"date"Name of date/timestamp column
target_columnColumn to forecast (required)
forecast_horizon121-512Periods to forecast
context_length6432-512Historical periods to use as input
epochs105-100Fine-tuning epochs
batch_size328-256
learning_rate1e-41e-6 to 1e-3

Prophet

Model ID: prophet-forecasting

ParameterDefaultOptionsNotes
date_column"date"
target_columnRequired
forecast_horizon121-365
seasonality_mode"additive""additive", "multiplicative"Multiplicative for % growth patterns
yearly_seasonality"auto""auto", true, false
weekly_seasonality"auto""auto", true, false
daily_seasonalityfalsetrue, falseOnly for sub-daily data
country_holidaysnull"US", "GB", "ES", etc.Add country public holidays
changepoint_prior_scale0.050.001-0.5Trend flexibility. Higher = more flexible

ARIMA

Model ID: arima-forecasting

ParameterDefaultRangeNotes
date_column"date"
target_columnRequired
forecast_horizon121-365
seasonaltruetrue, falseEnable SARIMA
m11, 4, 7, 12, 52Seasonal period (12=monthly, 7=daily)
information_criterion"aic""aic", "bic", "hqic"Model selection criterion
max_p51-10Max AR order
max_q51-10Max MA order

Classical Forecasting (Auto)

Model ID: classical-forecasting-auto

ParameterDefaultNotes
date_column"date"
target_columnsall numeric columnsList of columns to forecast (or single target_column)
forecast_horizon12
method"auto"Auto-selects Prophet, ARIMA, or ETS per series
country_holidaysnullApplied to Prophet when selected

Tuning Strategies

Start with Defaults

Always run with default hyperparameters first. For most tabular datasets, XGBoost defaults give strong results without tuning.

Use the Schema Endpoint

Get the exact parameter schema for any model:

curl "https://api.colabhive.com/api/builder/v1/training/model-configs/xgboost-regression/schema" \
-H "X-Account-ID: YOUR_ACCOUNT_ID" \
-H "X-API-Key: YOUR_API_KEY"

Key Levers (Tree-based)

  1. Overfitting (train metrics great, validation poor):

    • Reduce max_depth (try 4 instead of 6)
    • Increase reg_alpha or reg_lambda
    • Reduce n_estimators or add early stopping
    • Increase min_child_samples (LightGBM)
  2. Underfitting (both train and validation metrics poor):

    • Increase n_estimators
    • Increase max_depth or num_leaves (LightGBM)
    • Reduce learning_rate + increase n_estimators
  3. Slow training:

    • Use GPU model (e.g., xgboost-regression-gpu)
    • Reduce n_estimators for quick experiments

See Also