QFARM is a research tool for range-based rule mining, combining DFS rule-tree exploration with multi-objective genetic algorithms (Jenetics-based). It discovers high-quality rules of the form:
The system evaluates rules using multiple fitness metrics, evolves Pareto fronts, and outputs DOT graphs and JSON logs describing the search.
From the project root:
./gradlew shadowJar
The runnable JAR is generated at:
build/libs/qfarm-<version>.jar
Example:
build/libs/qfarm-0.1.build.jar
Rebuild the JAR whenever you modify the source code.
Basic syntax:
java -jar qfarm.jar \
--data <path/to.csv> \
--rhs <column_name> \
[--rhs-range <lo,hi> | --rhs-range-percentile <pLo,pHi>] \
[optional hyperparameters...]
--data
Path to CSV dataset.
NOTE: the full dataset is always loaded; no row or column limits are applied.
--rhs
Column name of the right-hand-side attribute.
Exactly one of:
--rhs-range
--rhs-range-percentile
Examples:
java -jar qfarm.jar \
--data data.csv \
--rhs y \
--rhs-range-percentile 90,100
java -jar qfarm.jar \
--data data.csv \
--rhs y \
--rhs-range 4.0, MAX
NOTE (zsh): Only quote bracket or no bracket expressions:
--rhs-range-percentile 90,100
--rhs-range-percentile "[90,100]"
Both ranges accept these formats: lo,hi lo..hi MIN,MAX MIN,6.0 4.0,MAX
All hyperparameters can be overridden through CLI flags.
Anything not provided falls back to defaults in HyperParameters.
--min-support (default: 100)
--max-support (default: 5000)
--max-depth (default: 2)
--max-children (default: 1)
--max-first-children (default: 1)
--evo-first-pop (default: 100)
--evo-first-gen (default: 100)
--evo-next-pop (default: 500)
--evo-next-gen (default: 200)
--evo-range-pop (default: 200)
--evo-range-gen (default: 500)
--prob-mutation (default: 1.0)
--std-mutation (default: 0.15)
--improvement-threshold (default: 10.0)
--excl-cols (default: [])
Comma-separated list of column names to exclude from the dataset before rule mining.
Example:
--excl-cols ID,Timestamp
--name (default: auto-generated)
Optional run name / experiment label.
Used for logging, plots, output directories, and DOT URLs.
Example:
--name experiment_1
java -jar qfarm.jar \
--data data/friedman1.csv \
--rhs y \
--rhs-range-percentile 80,100 \
--name experiment_1 \
--excl-cols id,timestamp \
--min-support 1 \
--max-support 500 \
--max-depth 5 \
--max-children 5 \
--max-first-children 5 \
--evo-cheap-pop 50 \
--evo-cheap-gen 50 \
--evo-full-pop 100 \
--evo-full-gen 100 \
--prob-mutation 0.8 \
--std-mutation 0.2 \
--alpha-threshold 0.01After execution, QFARM produces:
tree.dot
GraphViz DOT file describing the discovered rule tree (with color-coded cumulative front improvement).
tree.svg
The rendered tree.
step_log.json
NDJSON step-by-step evolution log.
stdout
Contains printed rules, evolutionary progress, and runtime information.
To run without rebuilding the JAR each time, add this to build.gradle.kts:
application {
mainClass = "MainKt"
}
Run with:
./gradlew run --args="--data data.csv --rhs LDL --rhs-range 4.0..7.0"
-
Fork this repository
-
Create a feature branch:
git checkout -b feature/my-feature -
Commit your work
-
Push your branch:
git push origin feature/my-feature -
Open a pull request
...