Java library and command-line application for converting R models to PMML.
ada
package:ada
- Stochastic Boosting (SB) classificationadabag
package:bagging
- Bagging classificationboosting
- Boosting classificationcaret
package:preProcess
- Transformation methods "range", "center", "scale" and "medianImpute"train
- Selected JPMML-R model typescaretEnsemble
package:caretEnsemble
- Ensemble regression and classificationCHAID
package:party
- CHi-squared Automated Interaction Detection (CHAID) classificationearth
package:earth
- Multivariate Adaptive Regression Spline (MARS) regressionelmNN
package:elmNN
- Extreme Learning Machine (ELM) regressionevtree
package:party
- Evolutionary Learning of Trees (EvTree) regression and classificatione1071
package:naiveBayes
- Naive Bayes (NB) classificationsvm
- Support Vector Machine (SVM) regression, classification and anomaly detectiongbm
package:gbm
- Gradient Boosting Machine (GBM) regression and classificationglmnet
package:glmnet
(elnet
, fishnet
, lognet
and multnet
subtypes) - Generalized Linear Model with lasso or elasticnet regularization (GLMNet) regression and classificationcv.glmnet
- Cross-validated GLMNet regression and calculationIsolationForest
package:iForest
- Isolation Forest (IF) anomaly detectionmlr
package:WrappedModel
- Selected JPMML-R model types.neuralnet
package:nn
- Neural Network (NN) regressionnnet
package:multinom
- Multinomial log-linear classificationnnet.formula
- Neural Network (NNet) regression and classificationparty
package:ctree
- Conditional Inference Tree (CIT) classificationpartykit
package:party
- Recursive Partytioning (Party) regression and classificationpls
package:mvr
- Multivariate Regression (MVR) regressionrandomForest
package:randomForest
- Random Forest (RF) regression and classificationranger
package:ranger
- Random Forest (RF) regression and classificationrms
package:lrm
- Binary Logistic Regression (LR) classificationols
- Ordinary Least Squares (OLS) regressionrpart
package:rpart
- Recursive Partitioning (RPart) regression and classificationr2pmml
package:scorecard
- Scorecard regressionstats
package:glm
- Generalized Linear Model (GLM) regression and classificationkmeans
- K-Means clusteringlm
- Linear Model (LM) regressionxgboost
package:xgb.Booster
- XGBoost (XGB) regression and classificationbase::I(..)
function terms:&
, |
and !
==
, !=
, <
, <=
, >=
and >
+
, -
, *
, /
, and %
^
and **
is.na
functionabs
, ceiling
, exp
, floor
, log
, log10
, round
and sqrt
base::cut()
and base::ifelse()
function termsplyr::revalue()
and plyr::mapvalues()
function termsEnter the project root directory and build using Apache Maven:
mvn clean install
The build produces an executable uber-JAR file target/jpmml-r-executable-1.4-SNAPSHOT.jar
.
A typical workflow can be summarized as follows:
The following R script trains a Random Forest (RF) model and saves it in RDS data format to a file rf.rds
:
library("randomForest")
rf = randomForest(Species ~ ., data = iris)
saveRDS(rf, "rf.rds")
Converting the RDS file rf.rds
to a PMML file rf.pmml
:
java -jar target/jpmml-r-executable-1.4-SNAPSHOT.jar --rds-input rf.rds --pmml-output rf.pmml
Getting help:
java -jar target/jpmml-r-executable-1.4-SNAPSHOT.jar --help
The conversion of large files (1 GB and beyond) can be sped up by increasing the JVM heap size using -Xms
and -Xmx
options:
java -Xms4G -Xmx8G -jar target/jpmml-r-executable-1.4-SNAPSHOT.jar --rds-input rf.rds --pmml-output rf.pmml
Up-to-date:
Slightly outdated:
JPMML-R is licensed under the terms and conditions of the GNU Affero General Public License, Version 3.0.
If you would like to use JPMML-R in a proprietary software project, then it is possible to enter into a licensing agreement which makes JPMML-R available under the terms and conditions of the BSD 3-Clause License instead.
JPMML-R is developed and maintained by Openscoring Ltd, Estonia.
Interested in using Java PMML API software in your company? Please contact [email protected]