Skip to content
/ mlpack.Rpkg Public template

Demo R package using 'mlpack' header via 'Rcpp'

Notifications You must be signed in to change notification settings

cgiachalis/mlpack.Rpkg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R package with 'mlpack' library

A small R demo package that calls a C++ function using mlpack library which then it is integrated into R via Rcpp framework.

Installation

You can install the mlpack.Rpkg using:

library(remotes)

remotes::install_github("cgiachalis/mlpack.Rpkg")

Example

library(mlpack.Rpkg)

set.seed(1234)
x <- matrix(rnorm(10*5), ncol = 5)

res <- knnDemo(x, k = 3)

# mlpack's knn
res2 <- mlpack::knn(query = x, reference = x, k = 3)

# sanity check
all.equal(res, res2[-3]) # TRUE

About

Demo R package using 'mlpack' header via 'Rcpp'

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published