plot_cluster_centers: Plot Template Cluster Centers

View source: R/cluster_plot.R

plot_cluster_centersR Documentation

Plot Template Cluster Centers

Description

Plot the cluster centers of a cluster template created with make_clustering_template. This function uses a K-Means type algorithm to sort graphs from training documents into clusters. On each iteration of the algorithm, it calculates the mean graph of each cluster and finds the graph in each cluster that is closest to the mean graph. The graphs closest to the mean graphs are used as the cluster centers for the next iteration. Handwriter stores the cluster centers of a cluster template as graph prototypes. A graph prototype consists of the starting and ending points of each path in the graph, as well as and evenly spaced points along each path. The prototype also stores the center point of the graph. All points are represented as xy-coordinates and the center point is at (0,0).

Usage

plot_cluster_centers(template, plot_graphs = FALSE, size = 100)

Arguments

template

A cluster template created with make_clustering_template

plot_graphs

TRUE plots all graphs in each cluster in addition to the cluster centers. FALSE only plots the cluster centers.

size

The size of the output plot

Value

A plot

Examples

# plot cluster centers from example template
plot_cluster_centers(example_cluster_template)
plot_cluster_centers(example_cluster_template, plot_graphs = TRUE)


handwriter documentation built on Oct. 25, 2024, 1:06 a.m.