0
$\begingroup$

I am trying to do clustering on my data which consists of both categorical and continuous variables. I have some questions which I would like to ask:

  1. I am going to use the Gower Distance measure to find the similarties/dissimilarties between data points is that ok?

  2. Can I use K-Means clustering for mixed variables to perform clustering? If not I will use Two-Step Clustering but can Two-Step Clustering be performed in R? Also, if so which Hierarchical Algorithm will I have to use?

Thanks

$\endgroup$
5
  • 1
    $\begingroup$ Please search "K-means Gower" on the site. The question was asked several times already $\endgroup$
    – ttnphns
    Mar 1, 2019 at 9:39
  • $\begingroup$ @ttnphns - I have researched even before questioning here but there is not like a definite answer to my question as some of the answers are saying you can use K-Means some not and I don't know what I should actually do $\endgroup$ Mar 1, 2019 at 10:39
  • $\begingroup$ Please see my latest addition to here stats.stackexchange.com/a/15313/3277 $\endgroup$
    – ttnphns
    Mar 1, 2019 at 12:02
  • $\begingroup$ Two-step clustering (found in SPSS) acceps interval or nominal variables, but not ordinal or binary. stats.stackexchange.com/a/116859/3277. For nominal ones, it uses log-likelihood distance. $\endgroup$
    – ttnphns
    Mar 1, 2019 at 12:08
  • $\begingroup$ @ttnphns - I know about the Two Step Clustering but I am using R and it seems that there is no package that can be applied $\endgroup$ Mar 1, 2019 at 12:49

2 Answers 2

0
$\begingroup$

K-means can only be used in data sets where you can compute the arithmetic mean.

Use hierarchical clustering instead. It can use distance matrixes, including Gower distances.

$\endgroup$
0
$\begingroup$

No, k-means can only work for numeric data. If you have mixed-type data, then you can try k-prototypes, which integrates k-means for numeric data and k-modes for categorical data.

$\endgroup$
1
  • $\begingroup$ Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. $\endgroup$
    – Community Bot
    Jul 13 at 2:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.