def windowSequenceEval(DS, winsz, result):
 si_old = 0
 idx = 0
 x = []
 y = []
 seq_res = []
 for (i, si) in enumerate(DS['sequence_index'][1:].astype(int)):
  tar = DS['target'][(si - 1)]
  curr_x = si_old
  correct = 0.0
  wrong = 0.0
  while (curr_x < si):
   x.append(curr_x)
   if (result[idx] == tar):
    correct += 1.0
    y += [1.0, 1.0]
   else:
    wrong += 1.0
    y += [0.0, 0.0]
   idx += 1
   curr_x += winsz
   x.append(curr_x)
  seq_res.append(((100.0 * correct) / (correct + wrong)))
  print(('sequence %d correct: %g12.2%%' % (i, seq_res[(-1)])))
 seq_res = array(seq_res)
 print(('total fraction of correct sequences: ', ((100.0 * float((seq_res >= 0.5).sum())) / seq_res.size)))

def windowSequenceEval ( DS , winsz , result ) : si_old = 0 idx = 0 x = [ ] y = [ ] seq_res = [ ] for ( i , si ) in enumerate ( DS [ 'sequence_index' ] [ 1 : ] . astype ( int ) ) : tar = DS [ 'target' ] [ ( si - 1 ) ] curr_x = si_old correct = 0.0 wrong = 0.0 while ( curr_x < si ) : x . append ( curr_x ) if ( result [ idx ] == tar ) : correct += 1.0 y += [ 1.0 , 1.0 ] else : wrong += 1.0 y += [ 0.0 , 0.0 ] idx += 1 curr_x += winsz x . append ( curr_x ) seq_res . append ( ( ( 100.0 * correct ) / ( correct + wrong ) ) ) print ( ( 'sequence %d correct: %g12.2%%' % ( i , seq_res [ ( - 1 ) ] ) ) ) seq_res = array ( seq_res ) print ( ( 'total fraction of correct sequences: ' , ( ( 100.0 * float ( ( seq_res >= 0.5 ) . sum ( ) ) ) / seq_res . size ) ) )
take results of a window-based classification and assess/plot them on the sequence warning: not tested! .