PIEThePIE package implements Partially InterpretableEstimators (PIE), a framework that jointly train an interpretable modeland a black-box model to achieve high predictive performance as well aspartial model transparency.
To install the development version from GitHub, run thefollowing:
This section demonstrates how to generate synthetic data for transferlearning and apply the ART framework using different models.
The functiondata_process() allows you to processdataset into the format that fits with PIE model, includingcross-validation dataset (such as training, validation and testing) andgroup indicators for group lasso.
library(PIE)# Load the training datadata("winequality")# Which columns are numerical?num_col<-1:11# Which columns are categorical?cat_col<-12# Which column is the response?y_col<-ncol(winequality)# Data Processingdat<-data_process(X =as.matrix(winequality[,-y_col]),y = winequality[, y_col],num_col = num_col,cat_col = cat_col,y_col = y_col)Once the data is prepared, you can use thePIE_fit()function to train PIE model. In this example, we fit only with 5iterations using group lasso and XGBoost models.
Once your PIE model is trained, you can use thePIE_predict() function to predict on test data.