# LeapHorizontalBar

This object is used to visualize logits and histograms

```python
import numpy.typing as npt
from code_loader.contract.enums import LeapDataType

@dataclass
class LeapHorizontalBar:
    body: npt.NDArray[np.float32]
    labels: List[str]
    gt: Optional[npt.NDArray[np.float32]] = None
    type: LeapDataType = LeapDataType.HorizontalBar
```

<table><thead><tr><th width="167.39065467110788">Args</th><th></th></tr></thead><tbody><tr><td><code>body</code></td><td>np.ndarray float32 representation of the prediction confidences (length N) .</td></tr><tr><td><code>labels</code></td><td>a list of N strings representing the classes</td></tr><tr><td><code>gt</code></td><td>(optional) np.ndarray float32 representation of GT (length N).</td></tr></tbody></table>

## Examples

#### Basic Usage

```python
import numpy as np
from code_loader.contract.visualizer_classes import LeapHorizontalBar
from code_loader.contract.enums import LeapDataType
...


@tensorleap_custom_visualizer('label', visualizer_type=LeapDataType.HorizontalBar)
def animal_count_visualizer(num_of_cats: np.ndarray, num_of_dogs: np.ndarray) -> LeapHorizontalBar:
    body = [num_of_cats, num_of_dogs]
    labels = ['cats', 'dogs']
    return LeapHorizontalBar(body=body, labels=labels)
```


---

# Agent Instructions: 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:

```
GET https://docs.tensorleap.ai/tensorleap-integration/python-api/code_loader/visualizer_classes/leaphorizontalbar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
