Error calling rCBA::fpgrowth: method fpgrowth with signature (DDI)[[Ljava/lang/String; not found

140 Views Asked by At

I wrote the R code below to mine with the FP-Growth algorithm:

fpgabdata <- read.csv('../Agen Biasa.csv', header = FALSE)    
train <- sapply(fpgabdata, as.factor)    
train <- data.frame(train, check.names = TRUE)    
txns <- as(train,"transactions")    
abrulesfpg = rCBA::fpgrowth(txns, support = 0.25, confidence = 0.5, maxLength = 10, consequent = NULL, verbose = TRUE, parallel = TRUE)

But I get the following error:

Error in .jcall(jPruning, "[[Ljava/lang/String;", "fpgrowth", support,  :     
  method fpgrowth with signature (DDI)[[Ljava/lang/String; not found    

These are my data:

data that I use

1

There are 1 best solutions below

0
Noel Cosgrave On

The reason you are seeing this error is that the current implementation of the FP-growth algorithm in rCBA requires that you specify a value for the consequent (right hand side).

For example, the following should work, assuming you have sensible thresholds for support and confidence:

abrulesfpg = rCBA::fpgrowth(
    txns, 
    support = 0.25, 
    confidence = 0.5, 
    maxLength = 10, 
    consequent = "SPIRULINA", 
    verbose = TRUE, 
    parallel = TRUE
)

I know the OP is likely to have discovered this by now, but I've answered this just in case anyone else encounters the same error.