Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ModelOriented/corrgrapher
Visualize correlations between variables
https://github.com/ModelOriented/corrgrapher
explanatory-model-analysis model-visualization xai
Last synced: 3 months ago
JSON representation
Visualize correlations between variables
- Host: GitHub
- URL: https://github.com/ModelOriented/corrgrapher
- Owner: ModelOriented
- License: gpl-3.0
- Created: 2020-03-13T11:33:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-10T16:15:06.000Z (about 4 years ago)
- Last Synced: 2024-05-21T02:10:42.859Z (6 months ago)
- Topics: explanatory-model-analysis, model-visualization, xai
- Language: R
- Homepage: https://ModelOriented.github.io/corrgrapher/
- Size: 150 MB
- Stars: 13
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# corrgrapher
[![Travis build status](https://travis-ci.org/ModelOriented/corrgrapher.svg?branch=master)](https://travis-ci.org/ModelOriented/corrgrapher)
[![Codecov test coverage](https://codecov.io/gh/ModelOriented/corrgrapher/branch/master/graph/badge.svg)](https://codecov.io/gh/ModelOriented/corrgrapher?branch=master)
[![R build status](https://github.com/ModelOriented/corrgrapher/workflows/R-CMD-check/badge.svg)](https://github.com/ModelOriented/corrgrapher/actions)## Overview
When exploring data or models we often examine variables one by one. This analysis is incomplete if the relationship between these variables is not taken into account. The corrgrapher package facilitates simultaneous exploration of the Partial Dependence Profiles and the correlation between variables in the model.
The package [corrgrapher](https://github.com/ModelOriented/corrgrapher) is a part of the [DrWhy.AI](http://drwhy.ai/) universe.
## The solution - less numbers, more insights
This package aims to plot correlations between variables in form of a graph. Each node on it is associated with single variable. Variables correlated with each other (positively and negatively alike) shall be close, and weakly correlated - far from each other.
It is achieved through a physical simulation, where the nodes are treated as points with mass (and are pushing each other away) and edges are treated as mass-less springs. The length of a spring depends on absolute value of correlation between connected nodes. The bigger the correlation, the shorter the spring.
When you click on the node of the graph you can view the distribution or the Partial Dependence Plot for the selected variable.
## Installation
The easiest way to get `corrgrapher` is to install it from CRAN:
```{r}
install.packages("corrgrapher")
```Or the the development version from GitHub:
```{r}
devtools::install_github("ModelOriented/corrgrapher")
```## Examples
First, load the package
```
library('corrgrapher')
```### For data sets
For data frames the `corrgrapher` shows correlation network and histograms/distributions for features.
```
df <- as.data.frame(datasets::Seatbelts)
cgr <- corrgrapher(df)
cgr
```### For models
For models the `corrgrapher` shows partial dependencies. Use the `DALEX::explain()` function to create an adapter for any predictive model.
```
library(DALEX)
library(ranger)titanic_rgr <- ranger(survived ~ ., data = titanic_imputed, classification = TRUE)
titanic_exp <- explain(titanic_rgr, data = titanic_imputed, y = titanic_imputed$survived, verbose = FALSE)
cgr <- corrgrapher(titanic_exp)
cgr
```## See also
Feel free to take a look at articles about
[introduction](https://modeloriented.github.io/corrgrapher/articles/Introduction.html) and [customization](https://modeloriented.github.io/corrgrapher/articles/Customization.html) at
[package site](https://modeloriented.github.io/corrgrapher/index.html).## Acknowledgments
Work on this package was financially supported by the Polish National Science Centre under Opus Grant number 2017/27/B/ST6/0130.