README.md

RcppShark

Goal of this package is to allow users to use the Shark C++ machine learning library in their own R projects. Currently the github version from 19th februrary 2017 is used.

Basic Example

This package is meant to be used as a basis for other packages. Nonetheless you can use this directly. It can be loaded by

library(RcppShark)

We added only two basic examples, Budgeted Stochastic Gradient Descend (BSGD) and a four layered Deep Neural Network, to give you a feeling how RcppShark works. Remember, the goal of the package is not to wrap all existing functionality of Shark in R, but to give you access to a very powerful and fast machine learning library (We might add more pre-wrapped code in future, if there is enough interest). Now to use the Budgeted Stochastic Gradient Descend algorithm from Shark on your data, perpare a binary classification problem. Then you can call the wrapper with

model = SharkBSGDTrain (x, y, gamma = 0.5, C = 1.0, budget = 500)

The data has to be binary, with 0-1 labels (We do not check for that!). Notice that SharkBSGDTrain is just a nice wrapper for the underlying C++ implementation called BSGDWrapperTrain in BSGDWrapper.cpp. We exported this function too, in case you want to meddle directly with the underlying code. To predict, you simply go ahead and push your test data as well as the model the training produced to the predict function:

results = SharkBSGDPredict (x, model)

The results are now the predicted labels. You can go ahead and compute with your favorite R function statistics like test error etc.

Changes

The source code of Shark is largly unchanged. Apart from removing asserts (via -DNDEBUG) and replacing std::cout and similar things, some files had to be renamed, as there sulting path is either too long or does conflict with crossplatform compability. Notably:

Notes

Internal notes

Authors

Aydin Demircioglu (aydin.demircioglu /at/ ini.rub.de)

Credits

This package uses infrastructure from different packages. Thanks for their efforts go to

and obviously to all the R and Shark people for creating such nice packages.

License

GPL 3.0 for the R package, Shark 3.x itself is licensed under LGPL.



aydindemircioglu/RcppShark documentation built on May 11, 2019, 4:13 p.m.