ML Pattern mining
ml assoc itemsetsml assoc rulesml assoc sequencesml assoc sequence_rulesml assoc sequencesml assoc predict_nextml assoc utilityml assoc episodesml assoc subgraphsml assoc topk_rulesml assoc episode_rulesml assoc episode_rulesml assoc topk_episodesml assoc sequences_constrainedml assoc sequences_constrainedml assoc periodicml assoc periodicml assoc local_periodicml assoc rareml assoc rareml assoc rare_correlatedml assoc topk_utilityml assoc utility_periodsml assoc utility_rulesml assoc utility_rulesml assoc topk_subgraphs

ml assoc itemsets <json_transactions> <min_support> <type>


Description

    Frequent itemsets (FP-Growth), closed itemsets (FPClose: no superset with the same support) or maximal itemsets (FPMax: no frequent superset), with the support and the frequency

Parameters

    json_transactions:   The transactions: [[item, item...], ...] - String - required
    min_support:   The minimum frequency in ]0, 1] - Number - required
    type:   frequent, closed or maximal - String - required
admin
ml assoc itemsets "[[\"bread\", \"milk\"], [\"bread\", \"diaper\", \"beer\", \"eggs\"], [\"milk\", \"diaper\", \"beer\", \"cola\"], [\"bread\", \"milk\", \"diaper\", \"beer\"], [\"bread\", \"milk\", \"diaper\", \"cola\"]]" 0.6 "frequent"
mentdb
{"transactions": 5, "count": 8, "itemsets": [{"items": ["diaper"], "support": 4, "frequency": 0.8}, {"items": ["milk"], "support": 4, "frequency": 0.8}, {"items": ["bread"], "support": 4, "frequency": 0.8}, {"items": ["diaper", "beer"], "support": 3, "frequency": 0.6}, {"items": ["milk", "diaper"], "support": 3, "frequency": 0.6}, {"items": ["bread", "diaper"], "support": 3, "frequency": 0.6}, {"items": ["bread", "milk"], "support": 3, "frequency": 0.6}, {"items": ["beer"], "support": 3, "frequency": 0.6}]}
Maximal itemsets: the largest frequent baskets
admin
ml assoc itemsets "[[\"bread\", \"milk\"], [\"bread\", \"diaper\", \"beer\", \"eggs\"], [\"milk\", \"diaper\", \"beer\", \"cola\"], [\"bread\", \"milk\", \"diaper\", \"beer\"], [\"bread\", \"milk\", \"diaper\", \"cola\"]]" 0.4 "maximal"
mentdb
{"transactions": 5, "count": 4, "itemsets": [{"items": ["milk", "diaper", "cola"], "support": 2, "frequency": 0.4}, {"items": ["milk", "diaper", "beer"], "support": 2, "frequency": 0.4}, {"items": ["bread", "diaper", "beer"], "support": 2, "frequency": 0.4}, {"items": ["bread", "milk", "diaper"], "support": 2, "frequency": 0.4}]}
Used in use cases (2 recipes)

    Data scientist › Market basket analysis with association rules
    Sales & marketing analyst › Baskets that bring the most margin
Often used with

    json doc  ·  json iarray  ·  math min  ·  ml assoc rules  ·  ml assoc utility

ml assoc rules <json_transactions> <min_support> <min_confidence>


Description

    Association rules if -> then (Agrawal and Srikant, on the FP-Growth itemsets) with the support, the confidence P(then | if) and the lift (> 1 = positive association); sorted by lift

Parameters

    json_transactions:   The transactions - String - required
    min_support:   The minimum frequency in ]0, 1] - Number - required
    min_confidence:   The minimum confidence in [0, 1] - Number - required
admin
ml assoc rules "[[\"bread\", \"milk\"], [\"bread\", \"diaper\", \"beer\", \"eggs\"], [\"milk\", \"diaper\", \"beer\", \"cola\"], [\"bread\", \"milk\", \"diaper\", \"beer\"], [\"bread\", \"milk\", \"diaper\", \"cola\"]]" 0.6 0.7
mentdb
{"transactions": 5, "count": 8, "rules": [{"if": ["beer"], "then": ["diaper"], "support": 3, "frequency": 0.6, "confidence": 1, "lift": 1.25}, {"if": ["diaper"], "then": ["beer"], "support": 3, "frequency": 0.6, "confidence": 0.75, "lift": 1.25}, {"if": ["milk"], "then": ["bread"], "support": 3, "frequency": 0.6, "confidence": 0.75, "lift": 0.9374999999999998}, {"if": ["bread"], "then": ["milk"], "support": 3, "frequency": 0.6, "confidence": 0.75, "lift": 0.9374999999999998}, {"if": ["diaper"], "then": ["bread"], "support": 3, "frequency": 0.6, "confidence": 0.75, "lift": 0.9374999999999998}, {"if": ["bread"], "then": ["diaper"], "support": 3, "frequency": 0.6, "confidence": 0.75, "lift": 0.9374999999999998}, {"if": ["diaper"], "then": ["milk"], "support": 3, "frequency": 0.6, "confidence": 0.75, "lift": 0.9374999999999998}, {"if": ["milk"], "then": ["diaper"], "support": 3, "frequency": 0.6, "confidence": 0.75, "lift": 0.9374999999999998}]}
Used in use cases (1 recipe)

    Data scientist › Market basket analysis with association rules
Often used with

    math min  ·  ml assoc itemsets

ml assoc sequences <json_sequences> <min_support>


Description

    Sequential patterns (PrefixSpan): ordered lists of itemsets that appear in at least min_support of the sequences (not necessarily consecutive).
A sequence is a list of itemsets; a plain item is an itemset of one item: ["a", ["b", "c"], "d"].

Parameters

    json_sequences:   The sequences - String - required
    min_support:   The minimum frequency in ]0, 1] - Number - required
admin
ml assoc sequences "[[\"home\", \"search\", \"product\", \"cart\"], [\"home\", \"product\", \"cart\", \"pay\"], [\"search\", \"product\", \"cart\"], [\"home\", \"search\", \"product\"], [[\"home\", \"promo\"], \"product\", \"cart\", \"pay\"]]" 0.6
mentdb
{"sequences": 5, "count": 9, "patterns": [{"pattern": [["product"]], "support": 5, "frequency": 1}, {"pattern": [["home"], ["product"]], "support": 4, "frequency": 0.8}, {"pattern": [["product"], ["cart"]], "support": 4, "frequency": 0.8}, {"pattern": [["home"]], "support": 4, "frequency": 0.8}, {"pattern": [["cart"]], "support": 4, "frequency": 0.8}, {"pattern": [["home"], ["product"], ["cart"]], "support": 3, "frequency": 0.6}, {"pattern": [["home"], ["cart"]], "support": 3, "frequency": 0.6}, {"pattern": [["search"], ["product"]], "support": 3, "frequency": 0.6}, {"pattern": [["search"]], "support": 3, "frequency": 0.6}]}
Used in use cases (1 recipe)

    IoT & sensor engineer › Alarm sequences that precede a failure
Often used with

    equal  ·  ml assoc sequence_rules

ml assoc sequence_rules <json_sequences> <min_support> <min_confidence>


Description

    Sequential rules (RuleGrowth): when the items of if appear (in any order), the items of then appear later (in any order); support and confidence

Parameters

    json_sequences:   The sequences - String - required
    min_support:   The minimum frequency in ]0, 1] - Number - required
    min_confidence:   The minimum confidence in [0, 1] - Number - required
admin
ml assoc sequence_rules "[[\"home\", \"search\", \"product\", \"cart\"], [\"home\", \"product\", \"cart\", \"pay\"], [\"search\", \"product\", \"cart\"], [\"home\", \"search\", \"product\"], [[\"home\", \"promo\"], \"product\", \"cart\", \"pay\"]]" 0.4 0.7
mentdb
{"sequences": 5, "count": 7, "rules": [{"if": ["home"], "then": ["product"], "support": 4, "frequency": 0.8, "confidence": 1}, {"if": ["search"], "then": ["product"], "support": 3, "frequency": 0.6, "confidence": 1}, {"if": ["home", "search"], "then": ["product"], "support": 2, "frequency": 0.4, "confidence": 1}, {"if": ["product"], "then": ["cart"], "support": 4, "frequency": 0.8, "confidence": 0.8}, {"if": ["home"], "then": ["product", "cart"], "support": 3, "frequency": 0.6, "confidence": 0.75}, {"if": ["home"], "then": ["cart"], "support": 3, "frequency": 0.6, "confidence": 0.75}, {"if": ["home", "product"], "then": ["cart"], "support": 3, "frequency": 0.6, "confidence": 0.75}]}
Used in use cases (1 recipe)

    IoT & sensor engineer › Alarm sequences that precede a failure
Often used with

    equal  ·  ml assoc sequences

ml assoc sequences <json_sequences> <min_support> <type>


Description

    Sequential patterns of a type: frequent (PrefixSpan), closed (BIDE+: no longer pattern with the same support, one item per step) or maximal (MaxSP: no longer frequent pattern)

Parameters

    json_sequences:   The sequences - String - required
    min_support:   The minimum frequency in ]0, 1] - Number - required
    type:   frequent, closed or maximal - String - required
admin
ml assoc sequences "[[\"home\", \"search\", \"product\", \"cart\"], [\"home\", \"product\", \"cart\", \"pay\"], [\"search\", \"product\", \"cart\"], [\"home\", \"search\", \"product\"]]" 0.5 "closed"
mentdb
{"sequences": 4, "count": 7, "patterns": [{"pattern": [["product"]], "support": 4, "frequency": 1}, {"pattern": [["home"], ["product"]], "support": 3, "frequency": 0.75}, {"pattern": [["search"], ["product"]], "support": 3, "frequency": 0.75}, {"pattern": [["product"], ["cart"]], "support": 3, "frequency": 0.75}, {"pattern": [["home"], ["search"], ["product"]], "support": 2, "frequency": 0.5}, {"pattern": [["home"], ["product"], ["cart"]], "support": 2, "frequency": 0.5}, {"pattern": [["search"], ["product"], ["cart"]], "support": 2, "frequency": 0.5}]}
Maximal patterns: the longest frequent paths
admin
ml assoc sequences "[[\"home\", \"search\", \"product\", \"cart\"], [\"home\", \"product\", \"cart\", \"pay\"], [\"search\", \"product\", \"cart\"], [\"home\", \"search\", \"product\"], [[\"home\", \"promo\"], \"product\", \"cart\", \"pay\"]]" 0.4 "maximal"
mentdb
{"sequences": 5, "count": 3, "patterns": [{"pattern": [["home"], ["product"], ["cart"], ["pay"]], "support": 2, "frequency": 0.4}, {"pattern": [["home"], ["search"], ["product"]], "support": 2, "frequency": 0.4}, {"pattern": [["search"], ["product"], ["cart"]], "support": 2, "frequency": 0.4}]}
Used in use cases (1 recipe)

    IoT & sensor engineer › Alarm sequences that precede a failure
Often used with

    equal  ·  ml assoc sequence_rules

ml assoc predict_next <json_sequences> <json_prefix>


Description

    Predict the next item of a sequence with CPT+ (Compact Prediction Tree, Gueniche et al.), trained on the sequences: the best item and the score of each candidate

Parameters

    json_sequences:   The training sequences of items - String - required
    json_prefix:   The beginning of the sequence to complete - String - required
admin
ml assoc predict_next "[[\"home\", \"search\", \"product\", \"cart\", \"pay\"], [\"home\", \"product\", \"cart\", \"pay\"], [\"search\", \"product\", \"cart\", \"pay\"], [\"home\", \"search\", \"product\", \"exit\"]]" "[\"product\", \"cart\"]"
mentdb
{"prediction": "pay", "candidates": [{"item": "pay", "score": 2.370903968811035, "share": 0.654764252778329}, {"item": "exit", "score": 1.250100016593933, "share": 0.34523574722167105}]}
Used in use cases (1 recipe)

    Machine learning engineer › Predict the next step of a user journey

ml assoc utility <json_transactions> <min_utility>


Description

    High utility itemsets (EFIM, Zida et al.): the item sets whose total utility (profit, margin, quantity...) in the transactions is at least min_utility, sorted by utility.
A transaction is [[item, utility], ...]; the utilities can have up to 4 decimals.
With negative utilities (promotions, losses), FHN (Fournier-Viger) is used automatically.

Parameters

    json_transactions:   The transactions: [[[item, utility], ...], ...] - String - required
    min_utility:   The minimum total utility - Number - required
admin
ml assoc utility "[[[\"bread\", 1.5], [\"wine\", 12.25]], [[\"bread\", 1.5], [\"cheese\", 4.8], [\"wine\", 12.25]], [[\"cheese\", 4.8], [\"wine\", 12.25]]]" 30
mentdb
{"transactions": 3, "count": 2, "itemsets": [{"items": ["wine"], "utility": 36.75}, {"items": ["cheese", "wine"], "utility": 34.1}]}
A promotion with a negative margin (FHN)
admin
ml assoc utility "[[[\"bread\", 1.5], [\"wine\", 12.25], [\"promo\", -3]], [[\"bread\", 1.5], [\"cheese\", 4.8], [\"wine\", 12.25], [\"promo\", -3]], [[\"cheese\", 4.8], [\"wine\", 12.25]]]" 10
mentdb
{"transactions": 3, "count": 8, "itemsets": [{"items": ["wine"], "utility": 36.75}, {"items": ["wine", "cheese"], "utility": 34.1}, {"items": ["bread", "wine"], "utility": 27.5}, {"items": ["bread", "wine", "promo"], "utility": 21.5}, {"items": ["bread", "wine", "cheese"], "utility": 18.55}, {"items": ["wine", "promo"], "utility": 18.5}, {"items": ["bread", "wine", "promo", "cheese"], "utility": 15.55}, {"items": ["wine", "promo", "cheese"], "utility": 14.05}]}
Used in use cases (2 recipes)

    Sales & marketing analyst › Baskets that bring the most margin
    Sales & marketing analyst › Promotions and seasonal products
Often used with

    json doc  ·  json iarray  ·  ml assoc itemsets  ·  ml assoc utility_periods

ml assoc episodes <json_events> <min_support> <max_window>


Description

    Frequent episodes in one sequence of timed events (EMMA, Huang and Chang): ordered groups of events that occur at least min_support times within max_window time units

Parameters

    json_events:   The events: [[time, item], [time, [items]], ...] (integer times) - String - required
    min_support:   The minimum number of occurrences - Number - required
    max_window:   The maximum duration of an episode - Number - required
admin
ml assoc episodes "[[1, \"T_HIGH\"], [2, \"VIB\"], [3, \"STOP\"], [10, \"T_HIGH\"], [11, \"VIB\"], [13, \"STOP\"], [20, \"VIB\"], [30, \"T_HIGH\"], [31, \"VIB\"], [32, \"STOP\"]]" 3 3
mentdb
{"timestamps": 10, "count": 5, "episodes": [{"episode": [["VIB"]], "support": 4}, {"episode": [["T_HIGH"], ["VIB"]], "support": 3}, {"episode": [["VIB"], ["STOP"]], "support": 3}, {"episode": [["T_HIGH"]], "support": 3}, {"episode": [["STOP"]], "support": 3}]}
Used in use cases (1 recipe)

    Industrial quality engineer › Alarm episodes that announce a stop
Often used with

    and  ·  equal

ml assoc subgraphs <json_graphs> <min_support>


Description

    Frequent subgraphs (gSpan, Yan and Han) in a set of labeled graphs, ex: molecules: each frequent subgraph with its vertex labels, its edges, its support and the graphs that contain it

Parameters

    json_graphs:   The graphs: [{"labels": [vertex labels], "edges": [[a, b, label], ...]}, ...] - String - required
    min_support:   The minimum frequency in ]0, 1] - Number - required
admin
ml assoc subgraphs "[{\"labels\": [\"C\", \"O\", \"C\"], \"edges\": [[0, 1, \"single\"], [1, 2, \"single\"]]}, {\"labels\": [\"C\", \"O\", \"H\"], \"edges\": [[0, 1, \"single\"], [1, 2, \"single\"]]}, {\"labels\": [\"C\", \"C\"], \"edges\": [[0, 1, \"double\"]]}]" 0.6
mentdb
{"graphs": 3, "count": 3, "subgraphs": [{"labels": ["C"], "edges": [], "support": 3, "frequency": 1, "graphs": [0, 1, 2]}, {"labels": ["O"], "edges": [], "support": 2, "frequency": 0.6666666666666666, "graphs": [0, 1]}, {"labels": ["C", "O"], "edges": [[0, 1, "single"]], "support": 2, "frequency": 0.6666666666666666, "graphs": [0, 1]}]}
Used in use cases (1 recipe)

    Process & reactor engineer › Frequent substructures of molecules

ml assoc topk_rules <json_transactions> <k> <min_confidence>


Description

    The k association rules with the highest support above a minimum confidence (TopKRules, Fournier-Viger et al.): no min_support to guess; the rules tied with the k-th are kept

Parameters

    json_transactions:   The transactions - String - required
    k:   The number of rules - Number - required
    min_confidence:   The minimum confidence in [0, 1] - Number - required
admin
ml assoc topk_rules "[[\"bread\", \"milk\"], [\"bread\", \"diaper\", \"beer\", \"eggs\"], [\"milk\", \"diaper\", \"beer\", \"cola\"], [\"bread\", \"milk\", \"diaper\", \"beer\"], [\"bread\", \"milk\", \"diaper\", \"cola\"]]" 3 0.7
mentdb
{"transactions": 5, "count": 7, "rules": [{"if": ["beer"], "then": ["diaper"], "support": 3, "frequency": 0.6, "confidence": 1}, {"if": ["bread"], "then": ["diaper"], "support": 3, "frequency": 0.6, "confidence": 0.75}, {"if": ["milk"], "then": ["bread"], "support": 3, "frequency": 0.6, "confidence": 0.75}, {"if": ["milk"], "then": ["diaper"], "support": 3, "frequency": 0.6, "confidence": 0.75}, {"if": ["diaper"], "then": ["bread"], "support": 3, "frequency": 0.6, "confidence": 0.75}, {"if": ["diaper"], "then": ["milk"], "support": 3, "frequency": 0.6, "confidence": 0.75}, {"if": ["diaper"], "then": ["beer"], "support": 3, "frequency": 0.6, "confidence": 0.75}]}

ml assoc episode_rules <json_events>


Description

    Partially ordered episode rules (POERM, Chen and Fournier-Viger) in one sequence of timed events: when the events of if occur in any order within x_span, the events of then follow in any order within y_span, the whole rule within window.
Default parameters: min_support 2 (occurrences of if), x_span 2, y_span 2, window 5, min_confidence 0.5

Parameters

    json_events:   The events: [[time, item], [time, [items]], ...] (integer times >= 1) - String - required
admin
ml assoc episode_rules "[[1, \"T_HIGH\"], [2, \"VIB\"], [3, \"STOP\"], [10, \"T_HIGH\"], [11, \"VIB\"], [13, \"STOP\"], [20, \"VIB\"], [25, \"P_LOW\"], [30, \"VIB\"], [31, \"T_HIGH\"], [32, \"STOP\"], [40, \"P_LOW\"], [41, \"T_HIGH\"]]"
mentdb
{"timestamps": 13, "count": 7, "rules": [{"if": ["T_HIGH", "VIB"], "then": ["STOP"], "support": 3, "if_support": 3, "confidence": 1}, {"if": ["T_HIGH"], "then": ["STOP"], "support": 3, "if_support": 4, "confidence": 0.75}, {"if": ["VIB"], "then": ["STOP"], "support": 3, "if_support": 4, "confidence": 0.75}, {"if": ["T_HIGH"], "then": ["VIB"], "support": 2, "if_support": 4, "confidence": 0.5}, {"if": ["P_LOW"], "then": ["T_HIGH", "VIB"], "support": 1, "if_support": 2, "confidence": 0.5}, {"if": ["P_LOW"], "then": ["T_HIGH"], "support": 1, "if_support": 2, "confidence": 0.5}, {"if": ["P_LOW"], "then": ["VIB"], "support": 1, "if_support": 2, "confidence": 0.5}]}

ml assoc episode_rules <json_events> <json_params>


Description

    Partially ordered episode rules with parameters: min_support, x_span, y_span, window, min_confidence

Parameters

    json_events:   The events - String - required
    json_params:   The parameters - String - required
admin
ml assoc episode_rules "[[1, \"T_HIGH\"], [2, \"VIB\"], [3, \"STOP\"], [10, \"T_HIGH\"], [11, \"VIB\"], [13, \"STOP\"], [20, \"VIB\"], [25, \"P_LOW\"], [30, \"VIB\"], [31, \"T_HIGH\"], [32, \"STOP\"], [40, \"P_LOW\"], [41, \"T_HIGH\"]]" "{\"min_support\": 2, \"x_span\": 3, \"window\": 4, \"min_confidence\": 0.6}"
mentdb
{"timestamps": 13, "count": 3, "rules": [{"if": ["T_HIGH", "VIB"], "then": ["STOP"], "support": 3, "if_support": 3, "confidence": 1}, {"if": ["T_HIGH"], "then": ["STOP"], "support": 3, "if_support": 4, "confidence": 0.75}, {"if": ["VIB"], "then": ["STOP"], "support": 3, "if_support": 4, "confidence": 0.75}]}
Used in use cases (1 recipe)

    IoT & sensor engineer › Event combinations that trip a pump
Often used with

    ml assoc topk_episodes

ml assoc topk_episodes <json_events> <k> <max_window>


Description

    The k most frequent episodes (TKE, Fournier-Viger et al.) within max_window time units: no min_support to guess

Parameters

    json_events:   The events - String - required
    k:   The number of episodes - Number - required
    max_window:   The maximum duration of an episode - Number - required
admin
ml assoc topk_episodes "[[1, \"T_HIGH\"], [2, \"VIB\"], [3, \"STOP\"], [10, \"T_HIGH\"], [11, \"VIB\"], [13, \"STOP\"], [20, \"VIB\"], [25, \"P_LOW\"], [30, \"VIB\"], [31, \"T_HIGH\"], [32, \"STOP\"], [40, \"P_LOW\"], [41, \"T_HIGH\"]]" 5 3
mentdb
{"timestamps": 13, "count": 5, "episodes": [{"episode": [["T_HIGH"]], "support": 4}, {"episode": [["VIB"]], "support": 4}, {"episode": [["STOP"]], "support": 3}, {"episode": [["VIB"], ["STOP"]], "support": 3}, {"episode": [["T_HIGH"], ["VIB"]], "support": 2}]}
Used in use cases (1 recipe)

    IoT & sensor engineer › Event combinations that trip a pump
Often used with

    ml assoc episode_rules

ml assoc sequences_constrained <json_sequences> <min_support>


Description

    Sequential patterns with constraints (CM-SPAM, Fournier-Viger et al.), here without constraint

Parameters

    json_sequences:   The sequences - String - required
    min_support:   The minimum frequency in ]0, 1] - Number - required
admin
ml assoc sequences_constrained "[[\"home\", \"search\", \"product\", \"cart\"], [\"home\", \"product\", \"cart\", \"pay\"], [\"search\", \"product\", \"cart\"], [\"home\", \"search\", \"product\"], [\"home\", \"faq\", \"product\", \"cart\"]]" 0.4
mentdb
{"sequences": 5, "count": 13, "patterns": [{"pattern": [["product"]], "support": 5, "frequency": 1}, {"pattern": [["cart"]], "support": 4, "frequency": 0.8}, {"pattern": [["home"], ["product"]], "support": 4, "frequency": 0.8}, {"pattern": [["home"]], "support": 4, "frequency": 0.8}, {"pattern": [["product"], ["cart"]], "support": 4, "frequency": 0.8}, {"pattern": [["home"], ["cart"]], "support": 3, "frequency": 0.6}, {"pattern": [["home"], ["product"], ["cart"]], "support": 3, "frequency": 0.6}, {"pattern": [["search"], ["product"]], "support": 3, "frequency": 0.6}, {"pattern": [["search"]], "support": 3, "frequency": 0.6}, {"pattern": [["home"], ["search"], ["product"]], "support": 2, "frequency": 0.4}, {"pattern": [["home"], ["search"]], "support": 2, "frequency": 0.4}, {"pattern": [["search"], ["cart"]], "support": 2, "frequency": 0.4}, {"pattern": [["search"], ["product"], ["cart"]], "support": 2, "frequency": 0.4}]}

ml assoc sequences_constrained <json_sequences> <min_support> <json_params>


Description

    Sequential patterns with constraints: max_gap (1 = the steps follow each other, 2 = one step can be skipped...), min_length and max_length (number of items)

Parameters

    json_sequences:   The sequences - String - required
    min_support:   The minimum frequency in ]0, 1] - Number - required
    json_params:   The constraints - String - required
admin
ml assoc sequences_constrained "[[\"home\", \"search\", \"product\", \"cart\"], [\"home\", \"product\", \"cart\", \"pay\"], [\"search\", \"product\", \"cart\"], [\"home\", \"search\", \"product\"], [\"home\", \"faq\", \"product\", \"cart\"]]" 0.4 "{\"max_gap\": 1, \"min_length\": 2}"
mentdb
{"sequences": 5, "count": 5, "patterns": [{"pattern": [["product"], ["cart"]], "support": 4, "frequency": 0.8}, {"pattern": [["search"], ["product"]], "support": 3, "frequency": 0.6}, {"pattern": [["home"], ["search"], ["product"]], "support": 2, "frequency": 0.4}, {"pattern": [["home"], ["search"]], "support": 2, "frequency": 0.4}, {"pattern": [["search"], ["product"], ["cart"]], "support": 2, "frequency": 0.4}]}

ml assoc periodic <json_transactions> <max_periodicity> <max_avg_periodicity>


Description

    Periodic frequent itemsets (PFPM, Fournier-Viger et al.): the itemsets that come back regularly in an ordered list of transactions (days, batches...); period = number of transactions between two occurrences (also from the start and to the end).
Kept if the longest period is <= max_periodicity and the average period <= max_avg_periodicity

Parameters

    json_transactions:   The transactions in time order - String - required
    max_periodicity:   The maximum period - Number - required
    max_avg_periodicity:   The maximum average period - Number - required
admin
ml assoc periodic "[[\"a\", \"b\"], [\"c\"], [\"a\", \"b\"], [\"c\", \"d\"], [\"a\", \"b\"], [\"d\"], [\"a\", \"b\"], [\"b\", \"d\"], [\"a\", \"b\"]]" 3 2
mentdb
{"transactions": 9, "count": 3, "itemsets": [{"items": ["b"], "support": 6, "min_period": 1, "max_period": 2, "avg_period": 1.2857142857142858}, {"items": ["a", "b"], "support": 5, "min_period": 2, "max_period": 2, "avg_period": 1.5}, {"items": ["a"], "support": 5, "min_period": 2, "max_period": 2, "avg_period": 1.5}]}

ml assoc periodic <json_transactions> <max_periodicity> <max_avg_periodicity> <json_params>


Description

    Periodic frequent itemsets with parameters: min_periodicity, min_avg_periodicity, min_length, max_length

Parameters

    json_transactions:   The transactions in time order - String - required
    max_periodicity:   The maximum period - Number - required
    max_avg_periodicity:   The maximum average period - Number - required
    json_params:   The parameters - String - required
admin
ml assoc periodic "[[\"a\", \"b\"], [\"c\"], [\"a\", \"b\"], [\"c\", \"d\"], [\"a\", \"b\"], [\"d\"], [\"a\", \"b\"], [\"b\", \"d\"], [\"a\", \"b\"]]" 3 2 "{\"min_length\": 2}"
mentdb
{"transactions": 9, "count": 1, "itemsets": [{"items": ["a", "b"], "support": 5, "min_period": 2, "max_period": 2, "avg_period": 1.5}]}
Used in use cases (1 recipe)

    Biologist & microbiologist › Genes over-expressed in cycles

ml assoc local_periodic <json_events> <max_period> <min_duration> <max_spill>


Description

    Local periodic itemsets (LPPGrowth, Fournier-Viger et al.): the time intervals where an itemset comes back at least every max_period (a total delay of max_spill is tolerated), during at least min_duration; periodic during a season and not the whole year

Parameters

    json_events:   The events: [[time, item], [time, [items]], ...] - String - required
    max_period:   The maximum time between two occurrences - Number - required
    min_duration:   The minimum duration of an interval - Number - required
    max_spill:   The tolerated total delay - Number - required
admin
ml assoc local_periodic "[[1, \"x\"], [2, \"x\"], [3, \"x\"], [4, \"y\"], [5, \"x\"], [6, \"x\"], [7, \"y\"], [15, \"x\"], [20, \"y\"], [21, \"x\"], [22, \"x\"], [23, \"x\"], [24, \"x\"]]" 2 3 1
mentdb
{"timestamps": 13, "count": 1, "itemsets": [{"items": ["x"], "intervals": [[1, 6], [21, 24]], "duration": 8}]}
Used in use cases (1 recipe)

    Climate & environment scientist › When are the hot days a regime?

ml assoc rare <json_transactions> <max_support>


Description

    Minimal rare itemsets (AprioriRare, Szathmary et al.): the itemsets whose frequency is below max_support while all their subsets are frequent; the rarest first

Parameters

    json_transactions:   The transactions - String - required
    max_support:   The rare threshold in ]0, 1] - Number - required
admin
ml assoc rare "[[\"a\", \"b\", \"c\"], [\"a\", \"c\"], [\"a\", \"d\"], [\"b\", \"c\", \"e\"], [\"a\", \"b\", \"c\", \"e\"], [\"b\", \"e\"], [\"a\", \"c\", \"f\"], [\"a\", \"b\", \"c\"]]" 0.3
mentdb
{"transactions": 8, "count": 4, "itemsets": [{"items": ["a", "e"], "support": 1, "frequency": 0.125}, {"items": ["d"], "support": 1, "frequency": 0.125}, {"items": ["f"], "support": 1, "frequency": 0.125}, {"items": ["c", "e"], "support": 2, "frequency": 0.25}]}

ml assoc rare <json_transactions> <min_support> <max_support>


Description

    Perfectly rare itemsets (AprioriInverse, Koh and Rountree): every item is rare (frequency below max_support) but the itemset appears at least min_support; rare events that come together

Parameters

    json_transactions:   The transactions - String - required
    min_support:   The minimum frequency of the itemset - Number - required
    max_support:   The maximum frequency of each item - Number - required
admin
ml assoc rare "[[\"a\", \"b\", \"c\"], [\"a\", \"c\"], [\"a\", \"d\"], [\"b\", \"c\", \"e\"], [\"a\", \"b\", \"c\", \"e\"], [\"b\", \"e\"], [\"a\", \"c\", \"f\"], [\"a\", \"b\", \"c\"]]" 0.2 0.5
mentdb
{"transactions": 8, "count": 1, "itemsets": [{"items": ["e"], "support": 3, "frequency": 0.375}]}
Used in use cases (1 recipe)

    Epidemiologist › Rare symptoms that come together
Often used with

    ml assoc rare_correlated

ml assoc rare_correlated <json_transactions> <max_support> <min_bond>


Description

    Rare correlated itemsets (CORI, Bouasker and Ben Yahia): groups of items with a frequency below max_support (1 = all the groups) and a bond >= min_bond; bond = transactions with all the items / transactions with at least one of them; the strongest bond first

Parameters

    json_transactions:   The transactions - String - required
    max_support:   The rare threshold in ]0, 1] - Number - required
    min_bond:   The minimum bond in ]0, 1] - Number - required
admin
ml assoc rare_correlated "[[\"a\", \"b\", \"c\"], [\"a\", \"c\"], [\"a\", \"d\"], [\"b\", \"c\", \"e\"], [\"a\", \"b\", \"c\", \"e\"], [\"b\", \"e\"], [\"a\", \"c\", \"f\"], [\"a\", \"b\", \"c\"]]" 0.5 0.4
mentdb
{"transactions": 8, "count": 1, "itemsets": [{"items": ["b", "e"], "support": 3, "frequency": 0.375, "bond": 0.6}]}
Every group of items, strongly bound
admin
ml assoc rare_correlated "[[\"a\", \"b\", \"c\"], [\"a\", \"c\"], [\"a\", \"d\"], [\"b\", \"c\", \"e\"], [\"a\", \"b\", \"c\", \"e\"], [\"b\", \"e\"], [\"a\", \"c\", \"f\"], [\"a\", \"b\", \"c\"]]" 1 0.6
mentdb
{"transactions": 8, "count": 2, "itemsets": [{"items": ["a", "c"], "support": 5, "frequency": 0.625, "bond": 0.7142857142857143}, {"items": ["b", "e"], "support": 3, "frequency": 0.375, "bond": 0.6}]}
Used in use cases (1 recipe)

    Epidemiologist › Rare symptoms that come together
Often used with

    ml assoc rare

ml assoc topk_utility <json_transactions> <k>


Description

    The k itemsets with the highest total utility (TKU, Tseng et al.): no min_utility to guess

Parameters

    json_transactions:   The transactions: [[[item, utility], ...], ...] - String - required
    k:   The number of itemsets - Number - required
admin
ml assoc topk_utility "[[[\"bread\", 1.5], [\"wine\", 12.25]], [[\"bread\", 1.5], [\"cheese\", 4.8], [\"wine\", 12.25]], [[\"cheese\", 4.8], [\"wine\", 12.25]], [[\"bread\", 1.5], [\"cheese\", 4.8]]]" 3
mentdb
{"transactions": 4, "count": 3, "itemsets": [{"items": ["wine"], "utility": 36.75}, {"items": ["wine", "cheese"], "utility": 34.1}, {"items": ["bread", "wine"], "utility": 27.5}]}

ml assoc utility_periods <json_transactions> <min_utility_ratio>


Description

    On-shelf high utility itemsets (FOSHU, Fournier-Viger and Zida): each transaction has a period (month, season...); the utility of an itemset is divided by the total utility of the periods where its items are sold (relative utility >= min_utility_ratio): a seasonal product is not penalized. The utilities can be negative

Parameters

    json_transactions:   The transactions: [[period, [[item, utility], ...]], ...] - String - required
    min_utility_ratio:   The minimum relative utility, ex: 0.5 - Number - required
admin
ml assoc utility_periods "[[1, [[\"bread\", 1.5], [\"wine\", 12.25]]], [1, [[\"bread\", 1.5], [\"cheese\", 4.8]]], [2, [[\"cheese\", 4.8], [\"mango\", 6], [\"wine\", 12.25]]], [2, [[\"mango\", 6], [\"wine\", 12.25]]]]" 0.5
mentdb
{"transactions": 4, "count": 4, "itemsets": [{"items": ["wine"], "utility": 36.75, "relative_utility": 0.5990220048899756}, {"items": ["wine", "mango"], "utility": 36.5, "relative_utility": 0.8837772397094431}, {"items": ["wine", "cheese", "mango"], "utility": 23.05, "relative_utility": 0.5581113801452785}, {"items": ["bread", "wine"], "utility": 13.75, "relative_utility": 0.685785536159601}]}
Used in use cases (1 recipe)

    Sales & marketing analyst › Promotions and seasonal products
Often used with

    ml assoc utility

ml assoc utility_rules <json_sequences> <min_utility> <min_confidence>


Description

    High utility sequential rules (HUSRM, Zida et al.): when the items of if appear (any order), the items of then follow (any order); the utility of the rule is the total utility of its items in the sequences where it applies

Parameters

    json_sequences:   The sequences of steps, a step = [[item, utility], ...] - String - required
    min_utility:   The minimum utility of a rule - Number - required
    min_confidence:   The minimum confidence in [0, 1] - Number - required
admin
ml assoc utility_rules "[[[[\"coffee\", 0.8]], [[\"croissant\", 1.2]], [[\"juice\", 2]]], [[[\"coffee\", 0.8]], [[\"croissant\", 1.2], [\"juice\", 2]]], [[[\"tea\", 0.5]], [[\"croissant\", 1.2]]], [[[\"coffee\", 0.8], [\"tea\", 0.5]], [[\"juice\", 2]]]]" 2 0.6
mentdb
{"sequences": 4, "count": 4, "rules": [{"if": ["coffee"], "then": ["juice"], "support": 3, "confidence": 1, "utility": 8.4}, {"if": ["coffee"], "then": ["croissant", "juice"], "support": 2, "confidence": 0.6666666666666666, "utility": 8}, {"if": ["coffee"], "then": ["croissant"], "support": 2, "confidence": 0.6666666666666666, "utility": 4}, {"if": ["coffee", "tea"], "then": ["juice"], "support": 1, "confidence": 1, "utility": 3.3}]}

ml assoc utility_rules <json_sequences> <min_utility> <min_confidence> <json_params>


Description

    High utility sequential rules with parameters: max_if, max_then (number of items, 4)

Parameters

    json_sequences:   The sequences of steps - String - required
    min_utility:   The minimum utility - Number - required
    min_confidence:   The minimum confidence - Number - required
    json_params:   The parameters - String - required
admin
ml assoc utility_rules "[[[[\"coffee\", 0.8]], [[\"croissant\", 1.2]], [[\"juice\", 2]]], [[[\"coffee\", 0.8]], [[\"croissant\", 1.2], [\"juice\", 2]]], [[[\"tea\", 0.5]], [[\"croissant\", 1.2]]], [[[\"coffee\", 0.8], [\"tea\", 0.5]], [[\"juice\", 2]]]]" 2 0.6 "{\"max_if\": 1, \"max_then\": 1}"
mentdb
{"sequences": 4, "count": 2, "rules": [{"if": ["coffee"], "then": ["juice"], "support": 3, "confidence": 1, "utility": 8.4}, {"if": ["coffee"], "then": ["croissant"], "support": 2, "confidence": 0.6666666666666666, "utility": 4}]}

ml assoc topk_subgraphs <json_graphs> <k>


Description

    The k most frequent subgraphs with at least one edge (TKG, Fournier-Viger et al.): no min_support to guess; the subgraphs tied with the k-th are kept

Parameters

    json_graphs:   The graphs: [{"labels": [...], "edges": [[a, b, label], ...]}, ...] - String - required
    k:   The number of subgraphs - Number - required
admin
ml assoc topk_subgraphs "[{\"labels\": [\"C\", \"C\", \"O\"], \"edges\": [[0, 1, \"s\"], [1, 2, \"d\"]]}, {\"labels\": [\"C\", \"O\", \"N\"], \"edges\": [[0, 1, \"d\"], [0, 2, \"s\"]]}, {\"labels\": [\"C\", \"C\", \"O\", \"N\"], \"edges\": [[0, 1, \"s\"], [1, 2, \"d\"], [1, 3, \"s\"]]}]" 3
mentdb
{"graphs": 3, "count": 5, "subgraphs": [{"labels": ["C", "O"], "edges": [[0, 1, "d"]], "support": 3, "frequency": 1, "graphs": [0, 1, 2]}, {"labels": ["C", "N"], "edges": [[0, 1, "s"]], "support": 2, "frequency": 0.6666666666666666, "graphs": [1, 2]}, {"labels": ["C", "O", "N"], "edges": [[0, 1, "d"], [0, 2, "s"]], "support": 2, "frequency": 0.6666666666666666, "graphs": [1, 2]}, {"labels": ["C", "C"], "edges": [[0, 1, "s"]], "support": 2, "frequency": 0.6666666666666666, "graphs": [0, 2]}, {"labels": ["C", "C", "O"], "edges": [[0, 1, "s"], [1, 2, "d"]], "support": 2, "frequency": 0.6666666666666666, "graphs": [0, 2]}]}
Used in use cases (1 recipe)

    Chemist › The most common substructures