Skip to content

API Reference

Complete reference for all BaseModel Python and YAML API surfaces. The documentation is organized around the two-stage modeling pipeline.

Foundation Model

Configuration and training of the self-supervised foundation model that learns general-purpose entity representations from behavioral data.

Scenario Model

Fine-tuning the foundation model for specific prediction tasks via the Python API.

Common Imports

# Foundation model training
from monad.ui import pretrain

# Loading models
from monad.ui.module import load_from_foundation_model, load_from_checkpoint

# Tasks
from monad.ui.module import (
    BinaryClassificationTask,
    MulticlassClassificationTask,
    MultilabelClassificationTask,
    RegressionTask,
    RecommendationTask,
    OneHotRecommendationTask,
)

# Configuration
from monad.config import TrainingParams, TestingParams, OutputType, MetricParams, EarlyStopping

# Target function utilities
from monad.targets import Events, Attributes
from monad.batch import SPLIT_TIMESTAMP, MODE, TRAINING_END_TIMESTAMP
from monad.ui.target_function import (
    sketch,
    sequential_decay,
    sketch_filtering_mask,
    has_incomplete_training_window,
    verify_target,
)
from monad.targets.recommendation import time_decay

# Interpretability
from monad.interpretability import interpret, interpret_entity
from monad.interpretability.treemap import TreemapGenerator

# Prediction utilities
from monad.ui.module import readout_sketch, read_target_entity_ids