aurelius

aurelius is a toolkit for translating models and analytics from the R programming language into the Portal Format for Analytics (PFA). There are functions for importing, exporting and converting common R classes of models into PFA. There are also functions for converting variable assignment, control structures, and other elements of the R syntax into PFA.

Getting Started

Install and Load aurelius Library

devtools::install_github('opendatagroup/hadrian', subdir='aurelius')
library("aurelius")

Build a Model and Save as PFA

The main purpose of the package is to create PFA documents based on logic created in R. This example shows how to build a simple linear regression model and save as PFA. PFA is a plain-text JSON format.

# build a model
lm_model <- lm(mpg ~ hp, data = mtcars)

# convert the lm object to a list of lists PFA representation
lm_model_as_pfa <- pfa(lm_model)

The model can be saved as PFA JSON and used in other systems.

# save as plain-text JSON
write_pfa(lm_model_as_pfa, file = "my-model.pfa")

Just as models can be written as a PFA file, they can be read.

my_model <- read_pfa("my-model.pfa")

Supported Models

The pfa() function in this package supports direct conversion to PFA for objects created by the following functions:

ModelFunctionPredictionLibraries
Autoregressive Integrated Moving Average (ARIMA)arima(), Arima(), auto.arima()Time Seriesstats, forecast
Classification and Regression Trees (CART)rpart()Classification, Regression, Survivalrpart
Exponential Smoothing State Spaceets(), ses(), hw(), holt()Time Seriesforecast
Generalized Boosted Regression Modelsgbm()Classification, Regression, Survivalgbm
Generalized Linear Modelglm()Classification, Regressionstats
Holt-Winters FilteringHoltWinters()Time Seriesstats, forecast
K-Centroids Clusteringkcca()Clusteringflexclust
K-Means Clusteringkmeans()Clusteringstats
k-Nearest Neighbourknn3(), knnreg(), ipredknn()Classification, Regressioncaret, ipred
Linear Discriminant Analysislda()ClassificationMASS
Linear Modellm()Regressionstats
Naive Bayes ClassifiernaiveBayes()Classificatione1071
Random ForestrandomForest()Classification, RegressionrandomForest
Regularized Generalized Linear Modelsglmnet(), cv.glmnet()Classification, Regression, Survivalglmnet

License

The aurelius package is licensed under the Apache License 2.0.

Copy Link

Version

Down Chevron

Install

install.packages('aurelius')

Monthly Downloads

15

Version

0.8.4

License

Apache License 2.0 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

July 3rd, 2017

Functions in aurelius (0.8.4)