Learn R Programming

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

Install

install.packages('aurelius')

Monthly Downloads

14

Version

0.8.4

License

Apache License 2.0 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Steven Mortimer

Last Published

July 3rd, 2017

Functions in aurelius (0.8.4)

avro_boolean

avro_boolean
avro_bytes

avro_bytes
aurelius

aurelius package
avro_array

avro_array
avro_int

avro_int
avro_long

avro_long
build_model.rpart

build_model.rpart
build_node_gbm

build_node_gbm
extract_params.glm

extract_params.glm
extract_params.glmnet

extract_params.glmnet
gen_unique_eng_name

gen_unique_eng_name
avro_double

avro_double
avro_enum

avro_enum
avro_type

avro_type
avro_typemap

avro_typemap
convert_fcn

convert_fcn
extract_params.Arima

extract_params.Arima
extract_params.ipredknn

extract_params.ipredknn
extract_params.kcca

extract_params.kcca
extract_params.kccasimple

extract_params.kccasimple
extract_params.kmeans

extract_params.kmeans
json_map

json_map
gen_unique_enum_name

gen_unique_enum_name
parse_string

parse_string
parse_value

parse_value
pfa

Generate PFA Document from Object
pfa.cv.glmnet

PFA Formatting of Fitted glmnet objects
pfa.lm

PFA Formatting of Fitted Linear models
pfa.naiveBayes

PFA Formatting of Fitted naiveBayess
pfa_engine

pfa_engine
avro_from_df

avro_from_df
avro_fullname

avro_fullname
avro_map

avro_map
avro_null

avro_null
parse_array

parse_array
pfa.gbm

PFA Formatting of Fitted GBMs
pfa.glm

PFA Formatting of Fitted GLMs
pfa.kmeans

PFA Formatting of Fitted K-means Models
avro_fixed

avro_fixed
avro_float

avro_float
avro_union

avro_union
pfa_expr

pfa_expr
build_model

build_model
build_node_randomForest

build_node_randomForest
build_node_rpart

build_node_rpart
extract_params.cv.glmnet

extract_params.cv.glmnet
extract_params.ets

extract_params.ets
avro_record

avro_record
avro_string

avro_string
build_model.naiveBayes

build_model.naiveBayes
build_model.randomForest

build_model.randomForest
extract_params.randomForest

extract_params.randomForest
extract_params.rpart

extract_params.rpart
gen_unique_fixed_name

gen_unique_fixed_name
extract_params.forecast

extract_params.forecast
extract_params.gbm

extract_params.gbm
extract_params.knn3

extract_params.knn3
extract_params.knnreg

extract_params.knnreg
parse_number

parse_number
parse_object

parse_object
pfa.ets

PFA Formatting of Fitted Exponential Smoothing State Space Models
pfa.forecast

PFA Formatting of Time Series Models Fit using Forecast Package
build_model.gbm

build_model.gbm
build_model.lda

build_model.lda
extract_params.HoltWinters

extract_params.HoltWinters
gen_unique_rec_name

gen_unique_rec_name
pfa.Arima

PFA Formatting of ARIMA Models
pfa.HoltWinters

PFA Formatting of Fitted Holt Winters Models
pfa.kcca

PFA Formatting of Fitted K-Centroid Models
extract_params

extract_params
extract_params.lda

extract_params.lda
extract_params.naiveBayes

extract_params.naiveBayes
gen_unique_symb_name

gen_unique_symb_name
pfa.knnreg

PFA Formatting of Fitted knns
pfa.lda

PFA Formatting of Fitted Linear Discriminant Models
pfa_pool

pfa_pool
pfa.kccasimple

PFA Formatting of Fitted K-Centroid Models
read_pfa

read_pfa
json_array

json_array
pfa.glmnet

PFA Formatting of Fitted glmnet objects
pfa.ipredknn

PFA Formatting of Fitted knns
pfa.randomForest

PFA Formatting of Fitted Random Forest Models
pfa.rpart

PFA Formatting of Fitted rpart Tree Models
pfa_cell

pfa_cell
pfa_document

pfa_document
pfa.knn3

PFA Formatting of Fitted knns
unjson

unjson
write_pfa

write_pfa