I have a dataset of names. Based on the alphanumeric strings of name,I need to map them to Subname as given below.
Name Subname
9-AIF-09 9A09
980-PD-Z09A 980P09
15-KIC-12 15K12
PIA-110H P-110
IC009A I009A
There can be defined rules like, if 'A' is present in name then keep all digits and alphabet 'A', 'P' is in the name then only 'P' is carried forward. Patterns must be identified by the algorithm itself about how a mapping is done.
Is there any algorithm I can use to identify patterns from training dataset to further predict.