map.kmeans.features: Kmeans distance to center feature mappings

Description Usage Arguments Value Author(s) Examples

View source: R/map_kmeans_features.R

Description

Creates mapping tables for each numerical feature containing the center for each feature's min and max value. These tables can then be applied using the function 'apply.kmeans.mappings' to calculate the distance to cluster center for each feature. Each feature is scaled by converting it to a range between 0 and 1 before clustering.

Usage

1
2
map.kmeans.features(data, x, clusters = 3, sample.size = 0.3,
  seed = 1, progress = TRUE)

Arguments

data

[required | data.frame] Dataset containing categorical features

x

[required | character] A vector of categorical feature names present in the dataset

clusters

[optional | integer | default=3] The number of clusters to create in each feature

sample.size

[optional | numeric | default=0.3] Percentage to down sample data for decreased computation time

seed

[optional | integer| default=1] The random number seed for reproducable results

progress

[optional | logical | default=TRUE] Display a progress bar

Value

List of data frames containing mapping tables

Author(s)

Xander Horn

Examples

1
res <- map.kmeans.features(data = iris, x = setdiff(names(iris), "Species"))

XanderHorn/lazy documentation built on Jan. 16, 2021, 6:15 p.m.