---
title: Analyze features using histograms
dataset_name: N/A
description: How to analyze numeric features using histograms, which let you analyze the distribution of values and view outlier values.
domain: platform
expiration_date: 10-10-2024
owner: izzy@datarobot.com
url: docs.datarobot.com/docs/tutorials/prep-learning-data/analyze-features-using-histograms.html

---

# Analyze features using histograms {: #analyze-features-using-histograms }

DataRobot generates a histogram for each numeric feature so that you can analyze the distribution of the feature's values and view outlier values. In this tutorial, you'll learn how to analyze numeric features using histograms.


## Takeaways {: #takeaways }

This tutorial explains how to use a histogram to:

* View the distribution of values for a feature
* Investigate outliers


## Visualize feature distribution {: #visualize-feature-distribution }

For numeric features, use the histogram to view a rough distribution of values.

1. [Import your dataset](import-data/index).

    ![](images/tu-eda-import-dataset.png)

    The sample dataset featured in this tutorial contains patient data.

    ![](images/tu-data-dataset.png)

    The goal is to predict the likelihood of patient readmission to the hospital. The target feature is `readmitted`.

    ??? tip
        See the [Assess data quality during EDA](assess-data-quality-eda) tutorial to learn how to use the Data Quality Assessment tool.

2. When the import completes, navigate to the **Project Data** list and select a feature.

    For numeric features, a histogram displays equal-sized ranges called *bins*. The height of each bar represents the number of rows with values in that range.

     ![](images/tu-histogram.png)

3.  Hover over a bin to view the range of the bin and the number of rows that fall within the range.

     ![](images/tu-histogram-bin-range.png)

     The `time_in_hospital` feature is the number of days spent in the hospital. The histogram indicates that a visit of one to three days is most common.

4. Click the **Showing** dropdown menu on the bottom left to change the number of bins.

    ![](images/tu-histogram-change-num-bins.png)

    With the additional bins, you can now see that a visit of *two to three* days is most common.

## Visualize outliers {: #visualize-outliers }

Use the histogram to investigate a feature that has outlier values.

1. Select a feature that has outliers if one exists in your feature list.

    ??? tip
        Use the [Data Quality Assessment](data-quality) tool to locate features with outliers. If a feature has outliers, a warning icon (![](images/icon-warning.png)) displays in the **Data Quality** column. The warning tip indicates the type of issue.


2. In the histogram that displays, toggle **Show outliers** on.

    ![](images/tu-histogram-show-outliers.png)

    The red dots at the top of the histogram are the outlier values. The gold box plot shows the middle quartiles for the data to help you determine whether the distribution is skewed.

3. Hover over a red dot to view the value of the outlier.

    ![](images/tu-histogram-outlier-value.png)

    In this example, the outlier shown for the `num_medications` feature is 74.1&mdash;far from the median of 14.

## View average target values {: #view-average-target-values }

After you kick off [EDA2](eda-explained#eda2), you can also view the average target values for features.

In the histogram, notice the orange circles that overlay the histogram.

![](images/tu-histogram-average-target-values.png)

The circles indicate the average target value for a bin. In this example, hospital visits of 8 days result in the highest average target value&mdash; for 8-day visits, 46.12% of rows have `readmitted` = 1.


## Learn more {: #learn-more }

**Related tutorials**

* [Assess data quality during EDA](assess-data-quality-eda)

**Documentation**

* [Histogram chart](histogram#histogram-chart)
* [EDA](eda-explained)
* [Data Quality Assessment](data-quality)