Skip to contents

Comprehensive EDA combining unsupervised learning techniques to understand data structure before modeling

Usage

tl_explore(data, response = NULL, max_components = 5, k_range = 2:6)

Arguments

data

A data frame

response

Optional response variable for colored visualizations

max_components

Maximum number of PCA components to keep (default: 5), or fewer if the data has fewer numeric columns

k_range

Range of k values for clustering (default: 2:6). Each is a whole number from 2 to one less than the number of rows, the range a silhouette is defined over.

Value

A list with class "tidylearn_eda" containing:

data

The original data frame.

response

The response variable name, or NULL.

pca

The fitted PCA model, keeping the first max_components components, as prcomp(rank. = max_components) would.

optimal_k

List with optimal cluster count results.

kmeans

The fitted k-means model.

hclust

The fitted hierarchical clustering model.

summary

List with n_obs, n_vars, n_components (the number kept), and best_k.

Examples

# \donttest{
eda <- tl_explore(iris, response = "Species")
#> Running Exploratory Data Analysis...
#> [1/4] PCA analysis...
#> [2/4] Finding optimal clusters...
#> [3/4] Clustering analysis...
#> [4/4] Distance analysis...
#> EDA complete!
plot(eda)

# }