Последовательность кластеризации в R

Я пытаюсь написать простое решение для кластеризации / группировки / упрощения R-последовательности. Я скорее новичок, давно не пользовался R, поэтому, пожалуйста, прости простые и глупые вопросы / решения. Задачи взяты из SAP, и они представляют выполнение процесса P2P.

Обзор:

Входные данные: после некоторых предложений я думаю, что входные данные должны охватывать слова вместо их идентификаторов (мы не хотим сравнивать числа, а упрощаем последовательность слов)

Вариант 1: последовательности шагов в SAP P2P, например:

Sequence 1:Purchase Order/NB > Goods Receipt/TA > Invoice Receipt/NA > Goods Receipt/TA 
Sequence 2:Purchase Order/NB > Goods Receipt/TA > Invoice Receipt/NA 

Мой набор данных содержит около 700 последовательностей (тест 100), оба они короткие (5 шагов) и длинные (даже больше 50).

Проблема в том, что я не хочу (во время интерпретации результатов) сравнивать все, т. Е. 700 последовательностей, но каким-то образом я хочу различать похожие. Часто, особенно для длинных последовательностей, различие обнаруживается после, например, 20 шагов, например:

Seq1: PR> PO> GR> IR> GR> IR > GR> IR> Оплата

Seq2: PR> PO> GR> IR> IR> GR > GR> IR> Оплата

В конце это должно привести к выявлению неэффективности процесса выполнения. У меня вопрос, есть ли у вас какие-либо предложения, как я могу подойти к этому королю вопроса? После прочтения ваших комментариев я не думаю, что кластерный подход является правильным. Меня не волнует, должны ли мы использовать кластеры или что-то еще, важно упрощение потоков.

Буду признателен за любые подсказки, предложения и т. Д.

Тестовые данные (> используется в качестве разделителя).

text_data <- c("Invoice Posting (Logistics invoice) > Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Clearing /KZ", 
"Purchase order/NB", "Purchase order/NB > Goods Receipt/WE", 
"Purchase order/NB > Goods Receipt/WE > Goods Return/WE", "Purchase order/NB > Goods Receipt/WE > Goods Return/WE > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/NB > Goods Receipt/WE > Invoice Posting (Account maintenance) > Invoice Receipt (Account maintenance)/AE", 
"Purchase order/NB > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE", 
"Purchase order/NB > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Clearing /KZ", 
"Purchase order/NB > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Clearing /ZA", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice)", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /ZA", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Clearing /KZ > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /ZA", 
"Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/ZI > Invoice Posting (Logistics invoice) > Clearing /AB", 
"Purchase order/NB > Goods Return/WE", "Purchase order/NB > Goods Return/WE > Credit Note (Logistics invoice)/RE > Credit Note Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/NB > Goods Return/WE > Credit Note (Logistics invoice)/RE > Credit Note Posting (Logistics invoice) > Clearing /ZA", 
"Purchase order/NB > Goods Return/WE > Credit Note Posting (Account maintenance) > Credit Note (Account maintenance)/AE", 
"Purchase order/NB > Goods Return/WE > Credit Note Posting (Logistics invoice) > Credit Note (Logistics invoice)/RE > Clearing /KZ", 
"Purchase order/NB > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Clearing /KZ", 
"Purchase order/NB > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Clearing /ZA", 
"Purchase order/NB > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Clearing /KZ", 
"Purchase order/UB", "Purchase order/UB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Goods Receipt/WE", 
"Purchase order/ZB", "Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/IE > Clearing /ZA", 
"Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/IE > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE > Clearing /ZA", 
"Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE > Invoice Posting (Logistics invoice)", 
"Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE > Invoice Posting (Logistics invoice) > Clearing /ZA", 
"Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE", 
"Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE > Clearing /ZA", 
"Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/IE > Clearing /ZA", 
"Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE > Clearing /ZA", 
"Purchase order/ZR", "Purchase order/ZR > Goods Receipt/WE", 
"Purchase order/ZR > Goods Receipt/WE > Goods Return/WE", "Purchase order/ZR > Goods Receipt/WE > Goods Return/WE > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Posting (Account maintenance) > Invoice Receipt (Account maintenance)/AE", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Account maintenance)/AE > Invoice Posting (Account maintenance)", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice)", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /AB", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /AB > Credit Note (Logistics invoice, cancel)/RE > Credit Note Posting (Logistics invoice, cancel) > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /AB > Credit Note (Logistics invoice, cancel)/RE > Invoice Receipt (Logistics invoice)/RE > Credit Note Posting (Logistics invoice, cancel) > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /AB > Credit Note (Logistics invoice, cancel)/RE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Credit Note Posting (Logistics invoice, cancel) > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Credit Note (Logistics invoice)/RE > Credit Note Posting (Logistics invoice)", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Credit Note (Logistics invoice)/RE > Credit Note Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/ZR > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/ZR > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE", 
"Purchase order/ZR > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Clearing /KZ", 
"Purchase order/ZR > Invoice Receipt (Logistics invoice)/RE > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase order/ZR > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Clearing /KZ", 
"Purchase requisition/NB", "Purchase requisition/NB > PR release - MRP /  RFQ / purchase order", 
"Purchase requisition/NB > PR release - RFQ / purchase order", 
"Purchase requisition/NB > Purchase order/NB", "Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Posting (Account maintenance) > Invoice Receipt (Account maintenance)/AE", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Clearing /AB", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Clearing /ZA", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice)", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /AB", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /AB > Credit Note (Logistics invoice, cancel)/RE > Invoice Receipt (Logistics invoice)/RE > Credit Note Posting (Logistics invoice, cancel) > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /AB > Credit Note (Logistics invoice, cancel)/RE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Credit Note Posting (Logistics invoice, cancel) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /ZA", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /ZA", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice)", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/RE > Invoice Posting (Logistics invoice) > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/ZI > Invoice Posting (Logistics invoice) > Clearing /AB", 
"Purchase requisition/NB > Purchase order/NB > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE", 
"Purchase requisition/NB > Purchase order/NB > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Clearing /AB", 
"Purchase requisition/NB > Purchase order/NB > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Clearing /KZ", 
"Purchase requisition/NB > Purchase order/NB > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/RE > Clearing /ZA", 
"Purchase requisition/NB > Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/IE", 
"Purchase requisition/NB > Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Goods Receipt/WE > Invoice Posting (Logistics invoice) > Invoice Receipt (Logistics invoice)/IE > Clearing /ZA", 
"Purchase requisition/NB > Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE", 
"Purchase requisition/NB > Purchase order/ZB > Delivery (Stock Transfer) > Goods Issue for Stock Transfer > Invoice Posting (Logistics invoice) > Goods Receipt/WE > Invoice Receipt (Logistics invoice)/IE > Clearing /ZA", 
"Purchase requisition/RV")

0 ответов

Другие вопросы по тегам