Documentation / ML Studio

Training

Design the strategy with eight questions, launch a training run, follow the curve live, compare experiments and report from your own script with the SDK.

On this page

Training in Yuli is a job with a plan, validation and a record: it keeps going even if you close the chat, it can be paused and it leaves a model version that is evaluated separately.

Design the strategy

In the Design tab, Yuli proposes a strategy and justifies it by answering eight questions:

#QuestionExample answer
1What it learnsWhether a customer will churn in the next 90 days.
2Which strategy it choseFrom scratch, with gradient boosting.
3WhyTabular data, 40,000 rows, no previous model.
4Which alternatives it evaluatedLogistic regression (baseline) and random forest.
5What resources it needsCPU, a few minutes, little memory.
6What limitations it hasIt doesn't know customers younger than one month.
7How we'll know it improvedTest F1 ≥ 0.85 and better than the baseline.
8Support levelHow well tested that path is in Yuli.

Review it, adjust whatever is needed and press Approve and train ›.

Strategies

StrategyWhen
From scratchThere is no previous model.
Warm startContinue from the weights of a previous version.
Fine-tuningAdapt an already trained model to your data.
Feature extractionUse a model as a feature generator.
Semi-supervisedFew labels and many unlabeled examples.
Self-supervisedLearn structure from unlabeled data.
Continual learningUpdate the model with new data without forgetting what it learned.

New training run

In New training run you fill in:

FieldWhat it is
DatasetThe data version used for training.
Column to predictThe target.
Frameworkscikit-learn, PyTorch, Transformers, XGBoost, LightGBM or your own script.
AlgorithmA specific one or Automatic (Yuli chooses).
EpochsHow many passes over the data (neural networks).
DeviceCPU or GPU.
ModeSingle run, Hyperparameter search or AutoML.

Included tabular algorithms: logistic and linear regression, ridge, lasso, random forest, extra trees, gradient boosting, decision tree, kNN, naive Bayes, SVM, SGD and MLP. For anomalies: isolation forest, LOF and robust z-score.

When you press Train, Yuli does three things in order:

  1. Plan: it calculates memory, time, device and risk.
  2. Validate: it checks that the data hasn't changed, that the Python environment is ready and that there are resources.
  3. Start: it launches the job.

States and controls

StateMeaning
QueuedWaiting for its turn or for resources (for example, “Waiting for VRAM: needs X, Y available”).
ValidatingPre-flight checks.
RunningTraining.
Pausing / PausedSaves a checkpoint and stops.
CompletedFinished and registered a version.
FailedStopped with an error; View log shows why.
CancelledYou stopped it.

Controls: Pause, Resume, Cancel and View log.

Live learning curve

The Learning curve plots loss and train and validation metrics while it trains, with Epoch n of N, Best so far, Elapsed, Remaining and, if it uses a GPU, GPU: name. Choose the smoothing (Raw, Smooth, Very smooth) and turn on Log scale when the loss drops by several orders of magnitude.

If the validation loss rises while the train loss keeps falling, the model is memorizing: Yuli warns of possible overfitting. Stop earlier or reduce the complexity.

Experiments stores every training run with its parameters, data and metrics so you can compare them side by side.

  • Hyperparameter search uses Optuna to try combinations and keep the best one on validation.
  • AutoML tries several algorithms and configurations for you.
  • If your team uses MLflow, you can mirror the experiments there (optional).

Your own script with the SDK

If you already have a training loop (spaCy included), use framework: script and report with yuli_ml.sdk. Your script appears in ML Studio just like a built-in adapter: curves, pause, checkpoints and a registered version.

python
# train.py
import numpy as np
import yuli_ml.sdk as yuli

epochs = 20
device = yuli.device()          # "cuda:0", "mps" or "cpu", depending on what Yuli reserved
yuli.info(f"Training on {device}")

start = 0
if yuli.resume_from():          # resume after a pause
    start = load_checkpoint(yuli.resume_from())

best_f1, best_epoch = 0.0, 0
for epoch in range(start, epochs):
    loss = train_one_epoch(device)
    f1 = validate()
    yuli.log("train/loss", loss, step=epoch, epoch=epoch)
    yuli.log("val/f1", f1, step=epoch, epoch=epoch, split="validation")
    if f1 > best_f1:
        best_f1, best_epoch = f1, epoch
    if yuli.should_stop():      # the user pressed Pause or Cancel
        path = yuli.checkpoint_dir()
        save_checkpoint(path, epoch)
        yuli.checkpoint(path, step=epoch, epoch=epoch, resumable=True)
        yuli.stop()
    yuli.progress(epoch + 1, epochs)

yuli.save_model({"layer.weight": np.zeros((4, 4))}, metrics={"f1": best_f1}, best_epoch=best_epoch)
FunctionWhat for
log, progress, infoLive metrics, progress and messages.
should_stop, checkpoint, checkpoint_dir, resume_fromPause, checkpoints and resume.
model_dir, save_model, reportThe version folder, final weights and evaluation reports.
device, use_gpuThe reserved device (and spacy.prefer_gpu() if you use spaCy).
warm_startThe weights of the version you are fine-tuning from.

Outside Yuli (python train.py in a terminal) every SDK call does nothing: your script keeps working on its own.

Need your own algorithm or metric? Write it in ml/extensions/*.py with @ext.algorithm, @ext.metric or @ext.transform, and use it like the built-in ones. Next step: Evaluation and models.