corrgrapher {corrgrapher} | R Documentation |
Create a corrgrapher
object
Description
This is the main function of corrgrapher
package. It does necessary calculations and creates a corrgrapher
object.
Feel free to pass it into plot
, include it in knitr report or generate a simple HTML.
Usage
corrgrapher(x, ...)
## S3 method for class 'explainer'
corrgrapher(
x,
cutoff = 0.2,
values = NULL,
cor_functions = list(),
...,
feature_importance = NULL,
partial_dependence = NULL
)
## S3 method for class 'matrix'
corrgrapher(x, cutoff = 0.2, values = NULL, cor_functions = list(), ...)
## Default S3 method:
corrgrapher(x, cutoff = 0.2, values = NULL, cor_functions = list(), ...)
Arguments
x |
an object to be used to select the method, which must satisfy conditions:
|
... |
other arguments. |
cutoff |
a number. Correlations below this are treated as no correlation. Edges corresponding to them will not be included in the graph. |
values |
a |
cor_functions |
a named |
feature_importance |
Either:
|
partial_dependence |
a named
If only one kind of data was used, use a list with 1 object. |
Details
Data analysis (and creating ML models) involves many stages. For early exploration, it is useful to have a grip not only on individual series (AKA variables) available, but also on relations between them. Unfortunately, the task of understanding correlations between variables proves to be difficult. corrgrapher 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.
Value
A corrgrapher
object. Essentially a list
, consisting of following fields:
nodes
- adata.frame
to pass as argumentnodes
tovisNetwork
functionedges
- adata.frame
to pass as argumentedges
tovisNetwork
functionpds
(if x was ofexplainer
class) - alist
with 2 elements:numerical
andcategorical
. Each of them contains an object ofaggregated_profiles_explainer
used to create partial dependency plots.data
- data used to create the object.
See Also
plot.corrgrapher
, knit_print.corrgrapher
, save_to_html
Examples
# convert the category variable
df <- as.data.frame(datasets::Seatbelts)
df$law <- factor(df$law)
cgr <- corrgrapher(df)