Skip to content

Instantly share code, notes, and snippets.

@ks--ks
Created November 4, 2016 23:20
Show Gist options
  • Select an option

  • Save ks--ks/82de8e0e253e373e535da18c1052563a to your computer and use it in GitHub Desktop.

Select an option

Save ks--ks/82de8e0e253e373e535da18c1052563a to your computer and use it in GitHub Desktop.
Code snippets for _____
data(mushroom)
X = mushroom[, -1]
y = as.numeric(mushroom[, 1]) # конвертировать метки в числа
gwd = FD::gowdis(X) # посчитать расстояние 'gower' для факторных переменных
gwd_mat = as.matrix(gwd) # конвертировать расстояния в матрицу
cm = Cluster_Medoids(gwd_mat, clusters = 2, swap_phase = TRUE, verbose = F)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment