> For the complete documentation index, see [llms.txt](https://docs.rhinofcp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rhinofcp.com/getting-started/quick-start-guide/federated-training-example-with-tabular-data.md).

# Federated Training Example with Tabular Data

Tabular data, such as electronic health records (EHR) or financial transaction data, can be used for both horizontal and vertical federated learning applications. In this article, we will use XGBoost to demonstrate the Federated Training flow.

XGBoost ([website](https://xgboost.readthedocs.io/en/stable/)) is a software library for training gradient-boosted trees for both classification and regression machine learning problems. It is widely accepted as a performant, cost-effective model for numeric and categorical tabular data applications.

In the Horizontal FL setting, each collaborator has distinct data samples (rows), and each row has the same set of features and is labeled. This contrasts with Vertical FL, in which only one collaborator possesses labels and the features may differ between collaborators’ datasets.

To implement Horizontal FL with [XGBoost](https://github.com/RhinoHealth/user-resources/tree/main/tutorials/advanced/federated-training/xgboost-horizontal), users may take advantage of tree-based model collaboration.

### Tree-Based Collaboration

Tree-based federated XGBoost is implemented as the following (see Figure 1):

1. Each collaborator performs 1 round of XGBoost training on their own data
2. Each collaborator shares the learned tree with the FL Server
3. The FL Server bags the locally-trained trees to produce a global model
4. The global model is shared with each of the collaborators
5. Each collaborator performs 1 round of boosting to obtain a new tree, and repeats…

![](/files/d09828dce3d1ebacd792efb8c77f895a71c8a6bc)

**Figure 1.** Illustrative schematic of tree-based collaboration for Federated XGBoost.

In this paradigm, only learned trees are ever shared with the FL Server/Rhino Orchestrator. The final set of aggregated trees (i.e., the final global model), can be stored on the FL server for future use (e.g., model evaluation on test sets and model inference).

For a comprehensive code example for how to implement Tree-Based XGBoost on the Rhino FCP, please visit our [user resources](https://github.com/RhinoHealth/user-resources/tree/main/tutorials/advanced/federated-training/xgboost-horizontal).
