# Convert XGBoost BDT regression model to TMVA

**URL:** <https://root-forum.cern.ch/t/convert-xgboost-bdt-regression-model-to-tmva/39251>\
**Category:** TMVA\
**Created:** [May 4, 2020, 1:44pm UTC](https://root-forum.cern.ch/t/convert-xgboost-bdt-regression-model-to-tmva/39251 "2020-05-04T13:44:41Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![swunsch](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/50afbb/32.png) [@swunsch](https://root-forum.cern.ch/u/swunsch)\
**Post date:** [May 12, 2020, 5:24pm UTC](https://root-forum.cern.ch/t/convert-xgboost-bdt-regression-model-to-tmva/39251/8 "2020-05-12T17:24:04Z")

</div>

Hi,

So the `Compute` function is like the `predict` in other frameworks, like sklearn or I think also xgboost. You can either put in your data as a `vector<float>`, a `RTensor<float>` or a `numpy.array`. However, if you want to inject the model prediction into an `RDataFrame`, you have to add it in a `Define` node. Actually, we have a tutorial for this [here](https://root.cern/doc/master/tmva103__Application_8C.html).

Further, if you want to do this from Python, we have currently the issue that the Python bindings break if you want to make the `TMVA::Experimental::Compute(model)` work. We just found this out in another forum thread, see [here](https://root-forum.cern.ch/t/rdataframe-and-tmva-in-pyroot/38930/2). There you find also the solution to this issue.

Best  
Stefan

---

_[View the full topic](https://root-forum.cern.ch/t/convert-xgboost-bdt-regression-model-to-tmva/39251)._
