SPMF -Wrappers for R, Python, Weka, Spark, etc.


SPMF is implemented in Java. If you want to use SPMF from Java or as a standalone program, please see the detailed instructions on installing and running SPMF on the download page.

If you want to use SPMF from other languages besides Java, this page provides a list of unofficial wrappers for various languages such as Python, R, Spark and Weka.

Note that these wrappers are unofficial. Thus, I do not offer support for them. Moreover, some of these wrappers do not offer all the features of SPMF.

If you are interested to write a new wrapper or to call SPMF from a program written in another language, it is actually not difficult because SPMF provides a command line interface and can take text files as input and output.

1) The Py-SPMF wrapper for Python

Author: Lorenz Leitner
Website: https://pypi.org/project/spmf/
Last update: >2020
Requirement: Python > 3
- This wrapper is said to support most of the sequential pattern mining algorithms offered in SPMF and may work for other algorithms but has not been tested for all of them .
- Input data can be specified as file or using data objects.
- Transformation of data to CSV and Panda data frames is supported.
- Several examples are offered of how to use the wrapper.
- To install the wrapper, it requires downloading the spmf.jar file from the download page of spmf, and installing the wrapper using pip: pip install spmf.
The wrapper can also be installed to be used as part of a python pipeline using pip install spmf-py (see webpage of the wrapper for details).

3) The SPMFWrapper for Weka

Author: Cristopher Beckham
Website: https://github.com/christopher-beckham/spmf-wrapper
Last update: ~2014
Requirement: Weka
- This is a Weka package for calling frequent itemset and association rule mining algorithms of SPMF.
- It works only for the algorithms that can take the ARFF format as input. This means that some algorithms like sequential rule mining algorithm will not work.
- Installing the package with ANT and CD is simple: ant -Dpackage=spmfWrapper make_package
Running an algorithm like Apriori is simple: java weka.Run weka.associations.SPMFWrapper -M Apriori -P 0.4 -t <file>.arff

3) A wrapper for R

Author: Michaël Benesty
Website: https://github.com/pommedeterresautee/spmf
Last update: ~2014
Requirement: R
- This is some R code for calling SPMF algorithms from R.
- The documentation is not very detailed but the code has several examples.
- It can be used as example of how to call SPMF from R.

4) Wrapper for the VMSP algorithm from Python

There a few other projects that have developed code to call SPMF from Python such as:

5) Wrapper for some algorithms from Spark

There a few other projects that have developed code to call SPMF from Python such as: