make_clustering_template {handwriter} | R Documentation |
Make Clustering Template
Description
make_clustering_template()
applies a K-means clustering algorithm to the
input handwriting samples pre-processed with process_batch_dir()
and saved
in the input folder main_dir > data > template_graphs
. The K-means
algorithm sorts the graphs in the input handwriting samples into groups, or
clusters, of similar graphs.
Usage
make_clustering_template(
main_dir,
template_docs,
writer_indices,
centers_seed,
K = 40,
num_dist_cores = 1,
max_iters = 25
)
Arguments
main_dir |
Main directory that will store template files |
template_docs |
A directory containing template training images |
writer_indices |
A vector of the starting and ending location of the writer ID in the file name. |
centers_seed |
Integer seed for the random number generator when selecting starting cluster centers. |
K |
Integer number of clusters |
num_dist_cores |
Integer number of cores to use for the distance calculations in the K-means algorithm. Each iteration of the K-means algorithm calculates the distance between each input graph and each cluster center. |
max_iters |
Maximum number of iterations to allow the K-means algorithm to run |
Value
List containing the cluster template
Examples
## Not run:
main_dir <- "path/to/folder"
template_docs <- "path/to/template_training_docs"
template_list <- make_clustering_template(
main_dir = main_dir,
template_docs = template_docs,
writer_indices = c(2, 5),
K = 10,
num_dist_cores = 2,
max_iters = 25,
centers_seed = 100,
)
## End(Not run)