Artifacts
For Maven projects, you can import the artifacts as shown below. The latest version can be found on the maven repository for com.arize.Surrogate SHAP Explainability
Thecom.arize.surrogate package adds a self-contained surrogate explainer to the Java SDK, the Java analog of the Python SDK’s surrogate_explainability=True option. Given the same features and predictions you would log to Arize, SurrogateExplainer trains a small gradient-boosted tree model that mimics your predictions and reads per-record, per-feature local attributions off that surrogate. There are no external dependencies, and access to your original model is not required.
The resulting maps can be passed directly as the shapValues argument of ArizeClient#bulkLog.
Supported Model Types
ModelType determines how prediction values are validated and interpreted:
SCORE_CATEGORICALandBINARY_CLASSIFICATION— explained against a prediction score that must be a probability in[0, 1]NUMERICandREGRESSION— explained against the predicted value directly, which must be finite (noNaNor infinite values)
Surrogate SHAP Behavior Notes
- Non-numeric (
String/Boolean) feature values are integer-encoded per column, mirroring the label encoding the Python implementation applies before fitting the surrogate. Missing feature values are supported, and routed through the trees via a learned default direction. - If no features are present, explainability is a no-op, and empty maps are returned for every record.
- The surrogate is trained on a (possibly sampled) subset of records for speed, but importances are computed for every record. A meaningful surrogate requires enough records to fit tree splits. If only a handful of records are present, every importance value will be
0.0. - Results are deterministic given the configured seed.
com.arize.examples.SendBulkPredictionWithSurrogate.
Questions? Email us at support@arize.com or Slack us in the #arize-support channel