Getting Started¶
Installation¶
rfgb
can be installed via the following methods:
Stable builds on PyPi
pip install rfgb
Development builds on GitHub
pip install git+git://github.com/hayesall/rfgb.git
Bleeding-edge development builds on the GitHub Development Branch
pip install git+git://github.com/hayesall/rfgb.git@development
Background¶
The main function of rfgb
is to learn relational dependency networks [1] via gradient tree boosting, based on Natarajan et al. “Boosting Relational Dependency Networks” [2].
This algorithm is implemented as the __main__
method for the rfgb
package.
# rfgb.__main__
from .boosting import updateGradients
from .tree import node
from .utils import Utils
# ... class Arguments:
parameters = Arguments().args
for target in parameters.target:
# Read the training data
trainData = Utils.readTrainingData(target,
path=parameters.train,
regression=parameters.reg,
advice=parameters.expAdvice)
# Initialize an empty list for the trees.
trees = []
# Learn each tree and update the gradients.
for i in range(parameters.trees):
node.setMaxDepth(2)
node.learnTree(trainData)
trees.append(node.learnedDecisionTree)
updateGradients(trainData, trees)
File Structure¶
File structure follows the structure used by BoostSRL.
Training directories and testing directories are currently used and flat files are read from, converted to a relational internal representation, and then the relationships may be reasoned about.
References¶
[1] Jennifer Neville and David Jensen, “Relational Dependency Networks.” Journal of Machine Learning Research (JMLR), 2007.
[2] Siraam Natarajan, Tushar Khot, Kristian Kersting, Bernd Gutmann, and Jude Shavlik, “Boosting Relational Dependency Networks. *International Conference on Inductive Logic Programming (ILP)*, 2010.