1
$\begingroup$

I am just a beginner in machine learning and finding tough time to understand few concepts. I have 10 strings of characters of length 50 each. These are the training data $T(i)$ for $i=1:10$. The first 5 come from class $A$ and next 5 from class $B$. Then there is an incoming string\test Test of same length. I calculate the number of common characters between each $T(I)$ and Test. Let this be a distance measure $dist(T(i),Test)$. Test will belong to or match a $T(i)$ if the number is maximum i.e Test $\epsilon$ max $dist(T(i),Test)$

  • Can this distance count serve as a feature for recognizing task maybe feeding this distance into a Bayes classifier or k-nn?
  • How can I apply clustering or classification for this kind such that I may know the incoming string is most similar to the training string and assign it to that class?

I know it is vague or maybe inappropriate but can somebody explain with a code how to do this and if it is valid to do so?

$\endgroup$
1
$\begingroup$

You use the word "test" to describe both the first ten strings you have and the ones that are presented to you later. You need to clarify what you're trying to do.

I would guess your first ten are your training set -- do they have labels? (A label is like an answer. It tells you what a perfect algorithm would output for this input.)

Or maybe you are just trying to say which of the training strings the incoming string is most similar to?

$\endgroup$
  • $\begingroup$ Sorry...I meant 10 training data, I edited it in the Question. These data arise from 2 classes A and B ; so the first 5 from class label A and next 5 from class label B; I have also added these info. $\endgroup$ – SKM Jul 29 '13 at 3:32

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.