> For the complete documentation index, see [llms.txt](https://medomicslab.gitbook.io/medfl-app-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://medomicslab.gitbook.io/medfl-app-docs/tutorials/simulation/experiment-results.md).

# Experiment Results

After a federated learning experiment finishes, MEDfl displays the experiment outputs in the **FL Pipeline Results** panel.

The information displayed depends on the selected model type. MEDfl currently supports result visualization for:

* **Neural Network models**
* **XGBoost models**

When several experiment configurations are executed, the configuration selector at the top of the Results panel can be used to switch between them, for example **Config 1** and **Config 2**.

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2F32PKVuzRaEb4JSsvAyhI%2FGroup%20121%20(1).png?alt=media&amp;token=ae7b7141-ffc9-4dae-83ea-12d6093e4916" alt=""><figcaption></figcaption></figure>

## :digit\_one:Neural Network Results

For Neural Network experiments, MEDfl organizes the results into four main views:

**Global Results**, **By Node**, **Compare Results**, and **SHAP Results**.

### 1. Global Results

The **Global Results** view provides an overview of the performance of the federated model across the participating clients.

MEDfl  visualizes model performance across the federated communication rounds.

The graph displays available metrics such as:

* **Accuracy**
* **AUC**
* **Loss**

for every federated round.

The horizontal axis represents the **federated round**, while the vertical axes represent model scores and loss.

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2FjpcI4BgQSnkWK3xp1rCS%2Fimage.png?alt=media&amp;token=5ccca109-4896-46fc-ad8a-5ffa1367ec6d" alt=""><figcaption></figcaption></figure>

Next to the confusion matrix, MEDfl displays additional metrics grouped according to their interpretation.

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2FkNhn665fD16HoIrHETYL%2FGroup%20121%20(2).png?alt=media&amp;token=c16e5dda-dd56-4b2c-967d-70ff7e1acf46" alt=""><figcaption></figcaption></figure>

### 2. Results by Node

The **By Node** view allows the user to inspect the performance of the federated model on an individual client.

A client can be selected from the **Select Node** field

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2FgTB6JxUcCRJ1nL95DZHQ%2FGroup%20123.png?alt=media&amp;token=d200bf46-1132-4b44-ad46-9ce44ae7bda3" alt=""><figcaption></figcaption></figure>

### 4. Federated SHAP Results

When Federated SHAP is enabled in the experiment configuration, MEDfl provides a dedicated **SHAP Results** view.

The interface summarizes:

* number of participating clients,
* total number of explained samples,
* SHAP explainer,
* most important feature,
* global feature importance,
* impact direction,
* direction distribution,
* client comparison,
* detailed SHAP statistics.

## Global SHAP Feature Importance

The **Global Importance** tab ranks the input features according to their **mean absolute SHAP value**.

Mean absolute SHAP is calculated from the magnitude of feature contributions without considering their direction.Consequently:

{% hint style="info" %}
A higher Mean |SHAP| means that the feature has a stronger overall influence on model predictions.
{% endhint %}

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2FkLEKpO8touen7evIEZK2%2FGroup%20122%20(1).png?alt=media&amp;token=6031f623-83de-44c1-9bae-25a8c6ac9b1a" alt=""><figcaption></figcaption></figure>

## SHAP Impact Direction

The **Impact Direction** tab uses the **mean signed SHAP value**.

MEDfl explicitly distinguishes:

* **positive SHAP values**, which increase the model output;
* **negative SHAP values**, which decrease the model output.

For a binary classification model where the modeled output represents the positive class:

* A positive value pushes the prediction toward the positive class.
* A negative value pushes it away from the positive class.

The magnitude represents the average strength of this directional effect.

A mean signed SHAP value close to zero does **not necessarily mean that the feature is unimportant**. Positive and negative contributions from different samples can cancel each other out. In such cases, the Mean |SHAP| value should also be examined.

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2FbCAjEqLJhbTxnBbbKBV7%2Fimage.png?alt=media&amp;token=970f2b8b-2c23-41b2-87c6-763c353ad681" alt=""><figcaption></figcaption></figure>

## SHAP Direction Distribution

The **Direction Distribution** view shows the percentage of explanations in which each feature produced:

* a positive SHAP value,
* a negative SHAP value,
* or a zero SHAP value.

This view is useful because the average signed SHAP value alone may hide different behaviors between individual samples.

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2FOMPTyMM7CIktMHkMPF7L%2Fimage.png?alt=media&amp;token=18fa08e5-a39b-499d-aa93-e767e4a71f03" alt=""><figcaption></figcaption></figure>

## Client SHAP Comparison

The **Client Comparison** tab displays feature importance separately for each federated client.

The graph compares the clients using their **Mean |SHAP|** values for each feature.

Similar feature importance across clients suggests that the global model behaves similarly on their local datasets.

Large differences may indicate that:

* different features are important for different clients,
* client datasets have different distributions,
* or the learned model behaves differently across local populations.

This visualization is particularly useful for investigating model behavior under **non-IID federated data**.

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2FxkA6m09Tgw8wusmVT79o%2Fimage.png?alt=media&amp;token=a372c65d-48fb-42b9-96db-93e591f5fff5" alt=""><figcaption></figcaption></figure>

## Detailed SHAP Results

The **Detailed Results** tab exposes the numerical statistics behind the SHAP visualizations.

MEDfl displays the following information for each feature:

* **Rank**
* **Feature**
* **Mean |SHAP|**
* **Mean signed SHAP**
* **Standard deviation**
* **Positive percentage**
* **Negative percentage**
* **Zero percentage**

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2FBI5XUodUnKQleInh1Q5L%2Fimage.png?alt=media&amp;token=9a11431c-15ba-4644-8d14-301d1f8bd26b" alt=""><figcaption></figcaption></figure>

## :digit\_two:XGBoost results&#x20;

The results are similar for both the Neural Network and XGBoost models. However, XGBoost provides an additional type of result: **feature importance**, which is calculated directly from the model itself. MEDfl calculates feature importance from the **final aggregated XGBoost model** and provides three importance measures:

**Gain**, **Weight**, and **Cover**.

These values provide different perspectives on how each feature is used by the trees.

### Gain

**Gain** measures the average improvement in the model objective produced by splits that use a particular feature.

In practical terms:

> Gain answers: **When the model uses this feature to split a tree, how useful is that split?**

A higher Gain means that splits using the feature generally improve the model more strongly.

The MEDfl interface describes Gain as the average improvement produced by splits using each feature.

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2F7ir3IevAm5hSxmiaiBBr%2FGroup%20122%20(2).png?alt=media&amp;token=88cc8761-1a8e-4004-bb64-fff60a45d5ce" alt=""><figcaption></figcaption></figure>

### Weight

**Weight** represents how frequently a feature is used to create splits across the trees of the model.

In practical terms:

> Weight answers: **How often does XGBoost use this feature?**

A high Weight indicates frequent use, but it does not necessarily mean that those splits are highly informative.

A feature can therefore have:

* high Weight but moderate Gain, or
* low Weight but very high Gain.

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2FxH7uTAW5fzUBE4r714Co%2FGroup%20122%20(3).png?alt=media&amp;token=43ffffb1-0087-40c2-b876-2f62b8e4f242" alt=""><figcaption></figcaption></figure>

### Cover

**Cover** represents the amount of training data affected by splits involving a feature.

In practical terms:

> Cover answers: **How many observations are affected when this feature is used for splitting?**

A high Cover indicates that the feature tends to participate in splits that apply to a relatively large portion of the training instances.

<figure><img src="https://2289920470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOpYh7tOQkAu0q6hPpqe9%2Fuploads%2F7jDR6istu0wKE4dZPdDV%2FGroup%20123%20(1).png?alt=media&amp;token=33c8bc16-f575-4bf7-88af-613c91e4d642" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://medomicslab.gitbook.io/medfl-app-docs/tutorials/simulation/experiment-results.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
