sequence classification model

Viewed 35

I have sequence of signal data

[   5948    5969    6015 ... 9476439 9476527 9476617]

which is 91509 long. For each of above value we have label

['+' 'N' 'V' ... 'N' 'N' 'N']

Current what I am doing is I am creating the window of particular length. eg window of length 100. So 91509 records will be divided into window of 100 size.

I give a label to each window

Label Priority

label2num={ 'A':1,'+':2, 'N':2, 'V':2, '"':2}

def PickLabel(row):
    if(label2num['A'] in row):  # If one label is A, assign it to A 
      return 'A'
    elif(label2num['V'] in row):  # If one label is V, assign it to V (No A should be present)
      return 'V'
    elif(np.all(row[row!=0] == label2num['N'])): ## If all labels are 'N'
      return "V"
    else:  # Else unclassified.
      return '~'

So now it is easy to create the classifier for above labeled data.

Problem - I am not getting good accuracy for above logic, where I take window of 100 size and do prediction.

Is there any algorithm or approach available, where it learns from sequence of characters and based on that it predicts the class name for input signal?

Priority is as per given in priority if-else section.

0 Answers
Related