Here is the R source code of the main algorithm:
GSP <- function (d,I,MIN_SUP){ f <- NULL c[[1]] <- CreateInitalPrefixTree(NULL) len4I <- GetLength(I) for(idx in 1:len4I){ SetSupportCount(I[idx],0) AddChild2Node(c[[1]], I[idx],NULL) } k <- 1 while( !IsEmpty(c[[k]]) ){ ComputeSupportCount(c[[k]],d) while(TRUE){ r <- GetLeaf(c[[k]]) if( r==NULL ){ break } if(GetSupport(r)>=MIN_SUP){ AddFrequentItemset(f,r,GetSupport(r)) }else{ RemoveLeaf(c[[k]],s) } } c[[k+1]] <- ExtendPrefixTree(c[[k]]) k <- K+1 } f }
Sequential Pattern Discovery using Equivalent classes (SPADE) is a vertical sequence-mining algorithm applied to sequence patterns; it has a depth-first approach. Here are the features of the SPADE algorithm:
The short description of SPADE algorithm goes here.
Here is the pseudocode before calling the SPADE algorithm, :
Here is the R source code of the main algorithm:
SPADE <- function (p,f,k,MIN_SUP){ len4p <- GetLength(p) for(idx in 1:len4p){ AddFrequentItemset(f,p[[idx]],GetSupport(p[[idx]])) Pa <- GetFrequentTidSets(NULL,MIN_SUP) for(jdx in 1:len4p){ xab <- CreateTidSets(p[[idx]],p[[jdx]],k) if(GetSupport(xab)>=MIN_SUP){ AddFrequentTidSets(pa,xab) } } if(!IsEmptyTidSets(pa)){ SPADE(p,f,k+1,MIN_SUP) } } }
18.189.195.229