DataSharp/Data/Analysis/Apriori.cs
/// <summary>
/// Returns true if there is a (k-1)-itemset of the candidate itmesets that is not in the frequent (k-1)-itemsets.
/// </summary>
/// <param name="candidate">A candidate itemset with k items.</param>
/// <param name="frequentItemsets">A collection that contains all frequent (k-1)-itemsets.</param>
/// <returns>True if there is a (k-1)-itemset of the candidate itmesets that is not in the frequent (k-1)-itemsets.</returns>
Returns true if there is a (k-1)-itemset of the candidate itmesets that is not in the frequent (k-1)-itemsets.
Returns true if there is a ( k - 1 ) - itemset of the candidate itmesets that is not in the frequent ( k - 1 ) - itemsets .
private static bool HasInfrequentSubset(SortedSet<string> potentialCandidateItemset, IEnumerable<SortedSet<string>> frequentItemsets)
        {
            int numSelection = potentialCandidateItemset.Count - 1;
            var subsets = SetHelper.GetSubsets(potentialCandidateItemset, numSelection);
            foreach (var s in subsets)
            {
                if (!SetHelper.ContainsSet(frequentItemsets, s))
                    return true;
            }
            return false;
        }
private static bool HasInfrequentSubset ( SortedSet < string > potentialCandidateItemset , IEnumerable < SortedSet < string > > frequentItemsets ) { int numSelection = potentialCandidateItemset . Count - 1 ; var subsets = SetHelper . GetSubsets ( potentialCandidateItemset , numSelection ) ; foreach ( var s in subsets ) { if ( ! SetHelper . ContainsSet ( frequentItemsets , s ) ) return true ; } return false ; }
Returns true if there is a (k-1)-itemset of the candidate itmesets that is not in the frequent (k-1)-itemsets.
Returns true if there is a ( k - 1 ) - itemset of the candidate itmesets that is not in the frequent ( k - 1 ) - itemsets .
// Get the value of (k-1). // Get all the subsets of candidate itemset. // Returns true if any of the subset is not a set in frequent (k-1)-itemsets, false otherwise.
True if there is a (k-1)-itemset of the candidate itmesets that is not in the frequent (k-1)-itemsets.
True if there is a ( k - 1 ) - itemset of the candidate itmesets that is not in the frequent ( k - 1 ) - itemsets .
potentialCandidateItemset
SortedSet<string>
frequentItemsets
IEnumerable<SortedSet<string>>
A collection that contains all frequent (k-1)-itemsets.
A collection that contains all frequent ( k - 1 ) - itemsets .
candidate
A candidate itemset with k items.
A candidate itemset with k items .