Xgboost Spark - pred contribution = True



I am trying to do prediction in spark using an xgboost model trained in python.

I have to use Pred contrib = true in the predict method.
I am unable to find it in the spark wrapper for xgboost. However in the scala API of xgboost Booster class there is a method for Pred contrib.

I want to do prediction on large data in a distributed mode. I have a spark data frame created on top of data. How should I proceed?


Take a look at https://xgboost.readthedocs.io/en/latest/jvm/xgboost4j_spark_tutorial.html


Hi… yes i did check that.
In XgBoost Spark wrapper i can call transform method on a dataframe and it returns the predictions.

There is a feature in Python version of xgboost where in predict method of i pass pred_contrib flag as true, it returns the feature contribution to that score as well.
I couldn’t find a similar thing in spark wrapper