Skip to content

Commit

Permalink
Add pairplots example
Browse files Browse the repository at this point in the history
  • Loading branch information
s2t2 committed Nov 1, 2024
1 parent 2ec1728 commit 33d39b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/notes/predictive-modeling/regression/multiple-features.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,17 @@ We see the most expensive homes are on the coast. So we can consider using latit

#### Pair Plots

One way to visualize the relationships between each combination of variables is using pairplots, however in practice this can take a long time to finish.
One way to visualize the relationships between each combination of variables is using the [`pairplots` function](https://seaborn.pydata.org/generated/seaborn.pairplot.html) from `seaborn`, however in practice this can take a long time to finish.

```{python}
#from seaborn import pairplot
#
from seaborn import pairplot
# using all the data (might take a long time):
#pairplot(df, hue="value")
#
# taking a sample in case it might complete faster:
#pairplot(df.sample(500, random_state=99), hue="value")
# taking sample of rows and less columns helps the plot complete faster:
df_sample = df.sample(100, random_state=99)
pairplot(df_sample[["rooms","income", "population", "value"]], height=1.3)
```

#### Correlation
Expand Down
3 changes: 3 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
# Robert Nau
# https://people.duke.edu/~rnau/411arim.htm
# https://online.stat.psu.edu/stat510/book/export/html/676
# An Introductory Study on Time Series Modeling and Forecasting
# Ratnadip Adhikari and R.K. Agrawal.
# 2013
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jupyter-cache
# packages required by any python code / notebooks:
#numpy
#matplotlib
seaborn
plotly
statsmodels # used by plotly for trendline parameter
requests
Expand Down

0 comments on commit 33d39b8

Please sign in to comment.