density_plot
Create 2d dimensionality reduction of sample fit to Bayesian network clusters
density_plot(cluster_results, var_selection = NULL, colourys = NULL)
cluster_results
: Cluster results from function get_clustersvar_selection
: Selected variables to consider, e.g. c(1:5) for first five onlycolourys
: A vector specifying the colors of each cluster (optional)A density plot of class recordedplot.
# Simulate data sampled_data <- sampleData(n_vars = 15, n_samples = c(200,200,200))$sampled_data # Learn clusters cluster_results <- get_clusters(sampled_data) # Load additional pacakges to create a 2d dimensionality reduction library(car) library(ks) library(ggplot2) library(graphics) library(stats) # Plot a 2d dimensionality reduction density_plot(cluster_results)
Useful links