--- title: EDA Visualization keywords: fastai sidebar: home_sidebar summary: "EDA Visualization." description: "EDA Visualization." nb_path: "nbs/visualization/eda.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}

#### `plot_sparse`[source]

> `plot_sparse`(`cat_lst`, `tgt_lst`)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

    df = pd.DataFrame.from_dict({
        'user_id':[1,1,1,2,2,2,2,2,3,3],
        'target': [1,0,0,0,1,0,0,1,1,1]
    })

    df

| user_id | target
--- | --- | ---
0 | 1 | 1
1 | 1 | 0
2 | 1 | 0
3 | 2 | 0
4 | 2 | 1
5 | 2 | 0
6 | 2 | 0
7 | 2 | 1
8 | 3 | 1
9 | 3 | 1

{% endraw %} {% raw %}

    plot_sparse(cat_lst=[1,1,1,2,2,2,3,3,4,5],
                tgt_lst=[1,1,0,1,1,0,0,0,1,0])

{% endraw %}

> References

> 1. https://nbviewer.org/github/sparsh-ai/stanza/blob/S543002/2021-06-19-recsys20-tutorial-feature-engineering-part-1.ipynb