0
$\begingroup$

What's the 'best' way to compare strings of characters of different lengths against an ideal sequential string of characters?

$\endgroup$
0
$\begingroup$

Welcome to the website! Consider using Dynamic Time Warping (DTW) which would address the issue that the lengths of the sequences may not be the same.

DTW is a time series alignment algorithm developed originally for speech recognition. It aims to align two sequences of feature vectors by warping the time axis iteratively until an optimal match between the two sequences is found.

This link gives a good visual and introductory explanation.

$\endgroup$
  • $\begingroup$ Thanks, Berkan. Can DTW cope with cases where the final character in the sequence isn't always the same? (I've updated my question to reflect this constraint.) $\endgroup$ – Pete Bloom Apr 9 at 11:06
  • $\begingroup$ You always need to establish the pairwise distances between the characters; e.g. what is the distance between A to E, versus B to C. Once this is done, the characters themselves should not matter. $\endgroup$ – Zhubarb Apr 9 at 12:14

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.