5
$\begingroup$

I have categorical data in the form of Y/N of 23 attributes and containing 200+ records. I need to compute the distance between the attributes with their class label. Which metric can be used?

$\endgroup$
5
  • 3
    $\begingroup$ Welcome to the site, @user857418. If your goal in calculating distances is to reduce the dimensionality of your data for subsequent use in a neural network model, or something like that, it would be worth mentioning that in the body of your question. $\endgroup$ Commented Jul 2, 2013 at 17:49
  • 4
    $\begingroup$ Your question may be related to this one $\endgroup$
    – ttnphns
    Commented Jul 2, 2013 at 18:24
  • $\begingroup$ In particular, @ttnphns suggestion would be applicable if you originally had a nominal variable with more than two levels and you transformed it into binary dummy variables. (The summary is that treating these as if they were originally binary variables is a mistake.) $\endgroup$
    – Wayne
    Commented Mar 5, 2014 at 16:54
  • $\begingroup$ stackoverflow.com/questions/12118720/… $\endgroup$ Commented Apr 9, 2014 at 18:57
  • $\begingroup$ Can you comment about the expected overlap in the categories? If two questions were essentially the same question, then they are going to have similar but not identical response vectors. If there is such overlap then you might want to perform a clustering first then measure distance between clusters. $\endgroup$ Commented Apr 9, 2014 at 19:00

3 Answers 3

1
$\begingroup$

I think this is the intended use of Gower (dis)similarity. This answer references the original paper and provides an example in R. This page and this page both have more detailed info.

$\endgroup$
1
$\begingroup$

Use mutual information to detect non-linear relationships between features. Cosine similarity is suited to compute the distance between records in a numerical data scenario. You need to compute the distance between features (the class is another feature) and you need to use a measure of association for contingency tables, where a contingency table stores the joint frequency distribution for a feature and the class.

$\endgroup$
0
$\begingroup$

cosine similarity is a good option, if I understand your problem description.

$\endgroup$
1
  • 14
    $\begingroup$ You forgot to say how you understood it and why you think cosine is good here. $\endgroup$
    – ttnphns
    Commented Jul 2, 2013 at 18:27

Your Answer

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

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