# Saving XGBOOst Model to PMML - possible now?

**URL:** <https://forum.knime.com/t/saving-xgboost-model-to-pmml-possible-now/45057>\
**Category:** KNIME Analytics Platform\
**Created:** [July 13, 2022, 1:34pm UTC](https://forum.knime.com/t/saving-xgboost-model-to-pmml-possible-now/45057 "2022-07-13T13:34:40Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [July 13, 2022, 10:13pm UTC](https://forum.knime.com/t/saving-xgboost-model-to-pmml-possible-now/45057/5 "2022-07-13T22:13:03Z")

</div>

@knimebine007 I toyed around with KNIME and Python and you could configure KNIME nodes that would use the XGBoost Python package and store the model in a local JSON file and reuse it with new data. The work will be done in Python but KNIME can create the workflow around.

From what I see is XGBoost still under development and some settings in the cooperation between KNIME and Python and XGB are maybe a bit strange but they will work and the jobs can be repeated.

The label is the column “Target” (0/1) and there is a “row\_id” present to stand for a possible customer number or ID to later bring the scores to another system. Some [XGBoost parameters](https://xgboost.readthedocs.io/en/stable/parameter.html) might have to be adapted.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/b/9b119b5111e5e09f0bf02e13112069d8a6e51141.png)

> **[use Python XGBoost package to build model and deploy that thru KNIME Python...](https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_python_xgboost~GBaTnzG3G4TsGhxo)**
>
> use Python XGBoost package to build model and deploy that thru KNIME Python nodes in the subfolder /data/ there is a Jupyter notebook to experiment and build X…

In the subfolder /data/ there is a Jupyter notebook “_kn\_example\_python\_xgboost.ipynb_” where I tried to set up a running workflow. Data can be interchanged between [Jupyter and KNIME](https://forum.knime.com/t/unicodeencodeerror-charmap-codec-cant-encode-characters/39199/3). And notebooks might also be run from within KNIME.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/b/e/be471e58693e01e2cb77707f5e6a81a5ea625b67.png)

Yes indeed the whole thing might be somewhat over-engineered but I always wanted to set up such a workflow - in general you will be best served with just using the great [KNIME XGBoost integration](https://kni.me/e/Hj6XVP_9hCGqZuKK) 🙂

---

_[View the full topic](https://forum.knime.com/t/saving-xgboost-model-to-pmml-possible-now/45057)._
