- Introduced by
- Chen, T. & Guestrin, C. (XGBoost); semi-supervised extension by multiple authors
- Year
- 2016–2018
- Type
- Ensemble (semi-supervised gradient boosting)
- Family
- Machine learning
What does it do?
Semi-supervised XGBoost applies the XGBoost gradient boosting framework to datasets in which only part of the training examples carry labels.
The model is first trained on the labeled subset, then assigns provisional labels to unlabeled examples and retrains on the enlarged set. It is aimed at tabular problems where labeled data are scarce but unlabeled records from the same feature space are available. Pseudo-labeling assumes that the unlabeled records come from the same distribution as the labeled ones; when that assumption fails, label errors propagate into the retrained model.
The intuition behind the method
When labels are expensive to obtain, such as clinical annotations, expert reviews, or rare-event records, most data arrives without ground truth. Semi-supervised XGBoost tries to use this unlabeled data rather than discard it. It first trains a conventional XGBoost model on the labeled subset, accepts predictions that pass a confidence threshold as provisional labels, and retrains on both sets. The added examples can shift the decision boundary, but only if the provisional labels are mostly correct, which is why the confidence filter matters.
History
XGBoost was introduced by Chen and Guestrin in 2016 (KDD proceedings). Pseudo-labeling is a general strategy in semi-supervised learning, and the procedure described on this page applies it to XGBoost as the base learner.
When to use it
Use semi-supervised XGBoost when the labeled set is too small for a reliable supervised XGBoost model, yet a substantial pool of unlabeled examples in the same feature space is available. The pattern is a plausible fit for settings such as medical record classification, fraud detection, and industrial quality control, where annotation is expensive relative to the volume of raw data. It suits tabular data with structured, mixed-type features. Avoid it when labeled data are already plentiful, since pseudo-labeling then adds complexity without clear gains. Avoid it also when the labeled and unlabeled distributions differ substantially (covariate shift), or when the labeled set is very small (informally, roughly 50 examples or fewer), so that the initial model cannot produce trustworthy pseudo-labels. The usable minimum depends on the problem and should be checked against a supervised baseline.
Limitations and considerations
- Performance degrades sharply if the initial labeled set is too small to produce reliable pseudo-labels, because errors accumulate across iterations.
- Covariate shift between labeled and unlabeled data can cause pseudo-labels to reflect the labeled distribution rather than the true unlabeled one.
- The threshold τ is heuristic; a poorly chosen cutoff either admits too many noisy labels or rejects useful unlabeled examples. The weight λ likewise has no established default and should be tuned on held-out labeled data.
- Interpretability remains limited, because the semi-supervised wrapper adds a layer of complexity on top of XGBoost's ensemble of trees.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Uses unlabeled rows from the same feature space, which can help when annotation is the bottleneck; the benefit depends on the unlabeled pool resembling the labeled data.
- Keeps the XGBoost base learner unchanged, so its sparsity-aware algorithm for sparse data and its tree-based modelling of nonlinear interactions carry over (Chen and Guestrin, 2016).
- The confidence threshold limits how many uncertain pseudo-labels enter training, which is the mechanism meant to distinguish this approach from unfiltered self-training.
- Each round retrains on a model that has already absorbed the previous round's pseudo-labels. If the early-round pseudo-labels are accurate, later rounds can refine them; if they are not, errors accumulate across rounds.
Applications
- Scenario: medical record classification, where expert annotations are costly but records are abundant.
- Scenario: fraud detection on transaction data with few confirmed fraud labels and many unlabeled transactions.
- Scenario: industrial defect detection from sensor logs where only some anomalies are manually verified.
- Scenario: credit risk modelling where historical default labels cover a small share of customers.
How it works
How it works
An XGBoost model is trained on the labeled portion of the dataset using the standard gradient-boosted tree objective. This supervised baseline establishes an initial decision boundary and serves as the labeling oracle for the next phase.
The trained model scores each unlabeled example. An unlabeled point is accepted as a pseudo-label only when its predicted score meets the threshold τ, so uncertain predictions are kept out of the augmented set. The threshold rule presupposes a scalar confidence score such as a predicted class probability, so it is written for classification; applying it to regression targets requires a different confidence criterion.
Formula
\hat{y}_u = f(x_u), \quad \hat{y}_u \geq \tauAccepted pseudo-labeled examples are added to the labeled training set as a separate group. The objective weights this group by λ, so their influence can be set below that of genuine labels to reflect their lower certainty.
XGBoost is retrained, from scratch or by fine-tuning, on the combined data. The objective sums a loss over the labeled examples and adds a λ-weighted loss over the accepted pseudo-labeled points, scored against the current model's predictions. The effect is to fit the labeled data while also keeping predictions consistent on the confidently labeled unlabeled points.
Formula
\mathcal{L} = \sum_{i \in L} \ell(y_i, \hat{y}_i) + \lambda \sum_{j \in U^*} \ell(\hat{y}_j, f(x_j))Steps 2 to 4 are repeated for a fixed number of rounds or until the pseudo-label assignments stop changing. Because the model changes between rounds, the set of accepted examples can change too, so the stopping rule should be checked against held-out labeled data.
Common pitfalls
- Using the full unlabeled pool without confidence filtering, which floods the model with uncertain pseudo-labels and degrades performance.
- Evaluating on a validation set that contains pseudo-labeled examples, or changing the validation fold between rounds, which gives optimistic or non-comparable accuracy estimates. Validation should use only genuinely labeled data that the model did not train on, and the same held-out fold should be used across rounds.
- Assuming that pseudo-labels improve accuracy without checking whether the unlabeled distribution matches the labeled one.
- Ignoring class imbalance among accepted pseudo-labels, especially in rare-event classification, where the high-confidence set may be dominated by the majority class.
- Treating convergence of pseudo-label assignments as a guarantee of correctness rather than as a stopping criterion.
Frequently asked questions
How many labeled examples are needed to start?
No validated minimum exists. Very small labeled sets, informally fewer than roughly 50 examples, often yield pseudo-labels too noisy to be useful. Whether semi-supervised training helps depends on the problem and should be checked against a supervised XGBoost baseline on the same validation folds.
How should the confidence threshold be set?
There is no validated default threshold. Choose τ by tuning on a held-out labeled validation set: tighten it if pseudo-label accuracy on that set is low, and relax it if too few unlabeled points are being incorporated.
Does semi-supervised XGBoost always outperform supervised XGBoost?
No. When the labeled set is already representative and large, the semi-supervised extension adds complexity without clear accuracy gains. It also tends to underperform when the unlabeled distribution is shifted relative to the labeled one.
Is this the same as transductive XGBoost or label propagation?
They are related but distinct. Pseudo-label semi-supervised XGBoost is an inductive method that produces a trained model applicable to new test points. Label propagation is a graph-based method that assigns labels to the unlabeled points already seen and does not generalise as directly to new data.
How do I prevent error accumulation across iterations?
Accept only high-confidence pseudo-labels, weight them below genuine labels, limit the number of iterations, and monitor accuracy on held-out labeled data after each round, stopping when it plateaus or begins to decline.
Related methods
Sources
Chen, T. & Guestrin, C. (2016). XGBoost: A Scalable Tree Boosting System. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 785–794.
Open DOI referenceChapelle, O., Scholkopf, B. & Zien, A. (Eds.) (2006). Semi-Supervised Learning. MIT Press.
ISBN: 978-0-262-03358-9