Rで頻出パターンマイニングと系列パターンマイニングの手順をまとめてみました。
頻出パターンマイニング
library(arules) #頻出パターンマイニングのライブラリ
library(arulesViz) #可視化のためのライブラリ
#データの読み込み
ds <- read.transactions('C:\\path\\to\\dataForR.csv', sep=',', format='basket')
#データ確認
str(ds)
summary(ds)
#頻出パターンマイニング
ds.ap <- apriori(ds) #ルール抽出
inspect(head(sort(ds.ap, by="support"),n=10)) #上位10件のルールの表示
plot(ds.ap,method='graph',control=list(type='items',layout=layout.show())) #可視化
系列パターンマイニング
系列
library(arulesSequences) #系列パターンマイニングのライブラリ
library(arulesViz) #可視化のためのライブラリ
#データ読み込み
ds2 <- read_baskets('C:\\path\\to\\dataForR.csv', sep = ',', info = c("sequenceID","eventID","SIZE"))
#系列パターンマイニング
ds2.sp <- cspade(ds2, parameter=list(support=0.001), control=list(verbose=TRUE))
ちなみに、arulesSequencesのcspadeはRstudioで発生するbugがあるようです。
上記に関して、間違いなどあればご指摘ください。