4
$\begingroup$

I'm trying to classify a histogram. I have 4 classes and I generate 4 histograms (h1, h2, h3 and h4) for each class. Each histogram contains 10 bins (attributes describing an object) on the x-axis and the frequencies on the y-axis. The problem is: given a new histogram (hn), find to which class it belongs.

My question; is there any simple classifier which can train based on the 4 predefined histograms and classify any new given histogram? and is there a Matlab implementation?

$\endgroup$
  • $\begingroup$ If you have a single histogram by class, you can run a chi-square test on the bin frequencies for each class. $\endgroup$ – Xi'an Apr 16 '15 at 15:15
  • $\begingroup$ currently I have one histogram for each class, but some class may have more than one histogram. So, I need a classifier can deal with that. $\endgroup$ – Omar14 Apr 16 '15 at 15:21
2
$\begingroup$

You can use nearest neighbor classification, with an appropriate distance metric. For example histogram intersection distance, $\chi^2$ distance, F-divergence, jensen-shannon divergence, or any other of the divergence measures you like.

$\endgroup$
  • $\begingroup$ My data looks like: [1 2 3 4 5 6 7 8 9 classLable]; where 1..9 is the frequancies of the attributes. [3 0 4 3 34 569 5 87 4 class1] this mean; in class 1; the frequency of attribute_1 = 3; the frequency of attribute_6 = 569 ...etc. [17 0 94 0 4 100 91 0 83 class2] [3 88 1 215 90 2 0 40 0 class3] [10 6 4 0 22 100 4 23 7 class4] Given the following histogram [1 0 5 0 20 120 0 50 3 class_?] find to which class this histogram belong? $\endgroup$ – Omar14 Apr 19 '15 at 18:17
  • $\begingroup$ To the one with the smallest distance, by whichever of above distances you decide to use. $\endgroup$ – Anony-Mousse Apr 19 '15 at 18:35
  • $\begingroup$ but I'm not sure how to fed my data to nearest neighbor classifier and use it to measure the distances. Is there any similar example explain the whole process. $\endgroup$ – Omar14 Apr 19 '15 at 18:46
  • $\begingroup$ So you choose Jensen-Shannon-Divergence, JSD. Then you compute JCD(query, train) for every training example, and the one with the smallest divergence is the most similar data point. You predict the same class as that data point. $\endgroup$ – Anony-Mousse Apr 19 '15 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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