Documentation Index
Fetch the complete documentation index at: https://mintlify.com/elenacarino-max/Pildora4_ext_StarWars/llms.txt
Use this file to discover all available pages before exploring further.
MLflow Jedi teaches the complete MLflow tracking cycle through six concepts, each mapped to a Star Wars narrative element. Working through the six chambers and three missions, students encounter these concepts in sequence: they first name their experiment, open a run, record the decisions taken before training, capture the numbers computed after evaluation, archive the diagnostic files, and finally preserve the trained estimator itself. Together the six steps form the 5–4–2–1 Jedi Code — five parameters, four metrics, two artifacts, one model — that anchors every mission in the activity.
Concept mapping table
Every screen in the app shows the narrative term alongside the professional term so that the vocabulary transfer is immediate.
| Narrative term | MLflow concept | Python call | Chamber |
|---|
| Biblioteca / Archivo de campañas | Experiment | mlflow.set_experiment() | 1 |
| Misión / Run | Run | mlflow.start_run() | 2 |
| Estrategia | Parameters | mlflow.log_params() | 3 |
| Consejo | Metrics | mlflow.log_metrics() | 4 |
| Holocrón | Artifacts | mlflow.log_artifact() | 5 |
| Jedi entrenado | Model | mlflow.sklearn.log_model() | 6 |
Experiment
An Experiment is a named container that groups all runs belonging to the same investigation. Think of it as a folder in the MLflow UI: every run you start will appear nested beneath it, making it easy to compare multiple training attempts side by side. In MLflow Jedi the experiment is called Biblioteca_Jedi_Digits — the Library that holds all campaign records.
mlflow.set_experiment("Biblioteca_Jedi_Digits")
Call this once before opening any run. If the experiment does not yet exist in the tracking server, MLflow creates it automatically. The app internally uses a session-scoped variant (Biblioteca_Jedi_Digits_{session_code}) so that different classroom sessions remain isolated.
Run
A Run is a single, bounded execution of an experiment — one training attempt with a specific set of hyperparameters. MLflow records its start time, end time, status, and everything logged inside it. The recommended pattern is to use a with block, which guarantees that the run is closed cleanly even if an exception occurs:
with mlflow.start_run(run_name="Mision_Coruscant"):
# all logging calls go here
...
The run_name keyword is optional but strongly encouraged: a human-readable name like Mision_Tatooine makes it far easier to identify runs in the comparison UI than an auto-generated UUID. In the activity each mission has a canonical run name (Mision_Tatooine, Mision_Coruscant, Mision_Mustafar), and the validator checks that name exactly.
Parameters
Parameters are the decisions you take before training begins — the knobs you turn on the algorithm. They are logged as a flat dictionary of string keys and scalar values. In the Digits missions the five canonical parameters are:
| Parameter | Type | Example values |
|---|
dataset | string | "digits" |
n_estimators | int | 50, 100, 300 |
max_depth | int or "None" | 8, 10, "None" |
test_size | float | 0.20 |
random_state | int | 42 |
mlflow.log_params(parametros)
Pass the entire dictionary in a single call. MLflow stores each key–value pair as a searchable parameter on the run record.
Metrics
Metrics are the numerical results you compute after training and evaluation. They are logged as a flat dictionary of string keys and float values. In the Digits missions the six tracked metrics are:
| Metric | Description |
|---|
accuracy | Overall fraction of correct predictions |
precision_weighted | Weighted-average precision across all classes |
recall_weighted | Weighted-average recall across all classes |
f1_weighted | Weighted-average F1 score across all classes |
recall_1 | Recall specifically for digit class “1” |
recall_8 | Recall specifically for digit class “8” |
mlflow.log_metrics(metricas)
The four “core” metrics (accuracy, precision_weighted, recall_weighted, f1_weighted) appear in every mission; recall_1 and recall_8 are surfaced in the Consejo comparison screen so teams can make an evidence-based recommendation.
Artifacts
Artifacts are files — images, JSON reports, CSVs — that provide richer diagnostic information than a single scalar. MLflow copies the file to the run’s artifact store and makes it accessible from the UI. The two mandatory artifacts in every mission are:
| File | Content |
|---|
matriz_confusion.png | Confusion-matrix heatmap (150 dpi PNG) |
classification_report.json | Per-class precision, recall, F1, and support |
mlflow.log_artifact("matriz_confusion.png")
mlflow.log_artifact("classification_report.json")
Both files are generated by execute_safe_mission using Matplotlib’s ConfusionMatrixDisplay and scikit-learn’s classification_report. Students view them directly in the Comparador and Consejo screens before completing their “Artefacto consultado” checklist.
Model
The Model is the trained scikit-learn estimator itself, serialised and versioned inside the run. Logging it with the MLflow sklearn integration adds a standardised wrapper that records the Python environment, the model signature (input/output schema), and an input example — everything needed to load and serve the model later.
mlflow.sklearn.log_model(
sk_model=modelo,
artifact_path="modelo_digits",
)
The artifact_path argument sets the sub-folder name within the run’s artifact store. Using "modelo_digits" keeps it consistent across all three missions and is the value the validator checks for.
Complete tracking example
The following snippet shows all six concepts assembled into one coherent block — the pattern students must reproduce in the Mustafar autonomous mission:
mlflow.set_experiment("Biblioteca_Jedi_Digits")
with mlflow.start_run(run_name="Mision_Mustafar"):
mlflow.log_params(parametros) # 5 parameters
mlflow.log_metrics(metricas) # 4 metrics
mlflow.log_artifact("matriz_confusion.png") # artifact 1
mlflow.log_artifact("classification_report.json") # artifact 2
mlflow.sklearn.log_model(
sk_model=modelo,
artifact_path="modelo_digits",
)
Key distinction: parameters are values you choose before training (hyperparameters and dataset settings); metrics are numbers you compute after evaluation (accuracy, F1, recall). Artifacts are files — images, reports — not scalars. Confusing these three categories is the sabotage introduced in the Coruscant mission.