category

# `frequent_pattern_mining_common`

Shared predicates for frequent itemset miner dataset validation, support accumulation, and itemset ordering/filtering helpers.

Availability:
`logtalk_load(frequent_pattern_mining_protocols(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-04-29
Compilation flags:
`static`
Extends:
`public` pattern_miner_common
Uses:
list
type
Remarks:
(none)
Inherited public predicates:
check_option/1 check_options/1 check_pattern_miner/1 default_option/1 default_options/1 diagnostic/2 diagnostics/2 export_to_clauses/4 export_to_file/4 mine/2 mine/3 option/2 option/3 pattern_miner_options/2 print_pattern_miner/1 valid_option/1 valid_options/1 valid_pattern_miner/1

## Public predicates

(no local declarations; see entity ancestors if any)

## Protected predicates

### `check_transactions/4`

Validates the collected dataset transactions and returns the maximum transaction length.

Compilation flags:
`static`
Template:
`check_transactions(Dataset,ItemDomain,Transactions,MaxTransactionLength)`
Mode and number of proofs:
`check_transactions(+object_identifier,+list(atom),+list(pair(integer,list(atom))),-integer)` - `one`

### `sort_patterns/2`

Sorts itemset patterns first by pattern length and then lexicographically.

Compilation flags:
`static`
Template:
`sort_patterns(Patterns0,Patterns)`
Mode and number of proofs:
`sort_patterns(+list(compound),-list(compound))` - `one`

### `filter_patterns/3`

Filters itemset patterns by minimum pattern length.

Compilation flags:
`static`
Template:
`filter_patterns(Patterns0,MinimumPatternLength,Patterns)`
Mode and number of proofs:
`filter_patterns(+list(compound),+integer,-list(compound))` - `one`

### `count_items/4`

Accumulates support counts for a list of items.

Compilation flags:
`static`
Template:
`count_items(Items,Count,ItemCounts0,ItemCounts)`
Mode and number of proofs:
`count_items(+list(atom),+integer,+list(pair(atom,integer)),-list(pair(atom,integer)))` - `one`

### `select_frequent_item_supports/3`

Selects the item supports that satisfy the minimum support count.

Compilation flags:
`static`
Template:
`select_frequent_item_supports(ItemCounts,SupportCount,FrequentItemSupports)`
Mode and number of proofs:
`select_frequent_item_supports(+list(pair(atom,integer)),+integer,-list(compound))` - `one`

### `valid_itemset_patterns/2`

True when the patterns are valid `itemset(Items, Support)` terms over the given item domain with positive integer supports.

Compilation flags:
`static`
Template:
`valid_itemset_patterns(ItemDomain,Patterns)`
Mode and number of proofs:
`valid_itemset_patterns(+list(atom),+list(compound))` - `zero_or_one`

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)