Implements in-context learning for tabular data using transformer architecture. Supports both classification (with hierarchical classification for many classes) and regression tasks. Includes KV caching for efficient inference.
Usage
ICLearning(
max_classes,
out_dim,
d_model,
num_blocks,
nhead,
dim_feedforward,
dropout = 0,
activation = "gelu",
norm_first = TRUE,
bias_free_ln = FALSE,
ssmax = FALSE,
recompute = FALSE
)Arguments
- max_classes
Integer. Determines task type and output behavior:
If
max_classes = 0: Regression using quantile predictionIf
max_classes > 0: Classification. Specifies native class support. If dataset classes exceed this, hierarchical classification is used.
- out_dim
Integer. Output dimension of the model.
- d_model
Integer. Model dimension for the transformer.
- num_blocks
Integer. Number of transformer blocks.
- nhead
Integer. Number of attention heads.
- dim_feedforward
Integer. Feedforward network dimension.
- dropout
Numeric. Dropout probability (default: 0.0).
- activation
Character or function. Activation function (default: "gelu").
- norm_first
Logical. Use pre-norm architecture (default: TRUE).
- bias_free_ln
Logical. Remove bias from LayerNorm (default: FALSE).
- ssmax
Logical or character. Scalable softmax type (default: FALSE).
- recompute
Logical. Use gradient checkpointing (default: FALSE).