peal.entrypoints.train_predictor

Train a predictor (student or test model) from a PredictorConfig YAML.

Drives ModelTrainer in peal/training/trainers.py, which builds the architecture named in the config, fits it on the dataset of the referenced data config and tracks accuracy and group accuracies on the validation split.

Invocation:

python train_predictor.py --config <predictor.yaml> \
    [--<any PredictorConfig field> value] [--wandb_project NAME]

Every PredictorConfig field is exposed as an optional --flag that overrides the YAML value, e.g. --continue_training True to resume from model_path or --is_loaded True to start from its saved weights. Unknown flags are ignored. A <PEAL_BASE> prefix in model_path is resolved to the project directory. A W&B run named predictor_<dataset_class> is opened when the package and an API key are available.

Writes the run directory model_path with config.yaml and the trained model pickled as model.cpl.

Functions

main

Load the PredictorConfig, apply overrides and fit the model.