# Using Knime Model in any software or making software with it.

**URL:** <https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530>\
**Category:** KNIME Analytics Platform\
**Created:** [July 13, 2018, 8:48am UTC](https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530 "2018-07-13T08:48:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kabus](https://forum-cdn.knime.com/user_avatar/forum.knime.com/kabus/32/1969_2.png) [@kabus](https://forum.knime.com/u/kabus)\
**Post date:** [July 13, 2018, 8:48am UTC](https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530/1 "2018-07-13T08:48:46Z")

</div>

Hello,

First of all, I am not a software developer. I am making [Salesforce.com](http://Salesforce.com) projects. I used our company’s sales quote data with Knime (Random Forest Learner and predictor) and achieved to make a model which can predict with %72,6 accuracy whether a sales quote will be accepted or not. I just want to use that model for our Sales Reps to see Sales Quote’s consequence before they reach out the customer. Any idea how to extract that model for using with another software and/or software developing using that model?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![nemad](https://forum-cdn.knime.com/user_avatar/forum.knime.com/nemad/32/53702_2.png) [@nemad](https://forum.knime.com/u/nemad)\
**Post date:** [July 13, 2018, 10:26am UTC](https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530/2 "2018-07-13T10:26:11Z")

</div>

Hello kabus,

you can export your Random Forest model to PMML like this:  
 ![export_rf_pmml](https://forum-cdn.knime.com/uploads/default/original/2X/0/01536f9324e07f80efa08bd1b3b1d06de756b652.PNG)  
Please note that the resulting PMML file will be very large because the trees in Random Forests are typically very deep.

Kind regards,

nemad

---

<div class="post-metadata">

**Author:** ![ScottF](https://forum-cdn.knime.com/user_avatar/forum.knime.com/scottf/32/61316_2.png) [@ScottF](https://forum.knime.com/u/ScottF)\
**Post date:** [July 13, 2018, 10:32am UTC](https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530/3 "2018-07-13T10:32:14Z")

</div>

Hi @kabus -

We also have a video that talks about different deployment methods. Maybe it would be useful?

[https://www.knime.com/blog/seven\_modes\_deployment](https://www.knime.com/blog/seven_modes_deployment)

---

<div class="post-metadata">

**Author:** ![kabus](https://forum-cdn.knime.com/user_avatar/forum.knime.com/kabus/32/1969_2.png) [@kabus](https://forum.knime.com/u/kabus)\
**Post date:** [July 13, 2018, 10:39am UTC](https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530/4 "2018-07-13T10:39:50Z")

</div>

Thanks, will be very useful.

---

<div class="post-metadata">

**Author:** ![kabus](https://forum-cdn.knime.com/user_avatar/forum.knime.com/kabus/32/1969_2.png) [@kabus](https://forum.knime.com/u/kabus)\
**Post date:** [July 13, 2018, 10:40am UTC](https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530/5 "2018-07-13T10:40:30Z")

</div>

Thanks you for fast reply, we could use that one i guess. Many thanks again.

---

<div class="post-metadata">

**Author:** ![nemad](https://forum-cdn.knime.com/user_avatar/forum.knime.com/nemad/32/53702_2.png) [@nemad](https://forum.knime.com/u/nemad)\
**Post date:** [July 13, 2018, 11:50am UTC](https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530/6 "2018-07-13T11:50:10Z")

</div>

Hi @kabus,

yet another possibility is to use the H2O Random Forest Learner from our H2O integration instead of the KNIME Random Forest Learner. You can then export the trained model as H2O MOJO object, which is far more memory efficient than the PMML representation and supposedly easily integrable into Java applications.  
 ![rf_mojo](https://forum-cdn.knime.com/uploads/default/original/2X/4/432b4403e8158aa428a9bcdc7dcd6264def5cf59.PNG)

You can find the H2O integration in KNIME Labs.

Cheers,

nemad

---

<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, 2018, 4:34pm UTC](https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530/7 "2018-07-13T16:34:47Z")

</div>

Another option ist just to use a decision tree and then convert the PMML to a SQL ruleset. Some other PMML files might also be converted to SQL. The code is not pretty and you might have to tweak it a little bit but is should work. I have used this on occasions when it was not possible to transfer the model in any other way.

Also simple decision trees you can convert to a ruleset you could use to write if then else statements (not pretty I know but at least this would get you a result).

MOJO files also look promising.

> [@Looking for options to evaluate a decision tree](https://forum.knime.com/t/looking-for-options-to-evaluate-a-decision-tree/11384/2):
>
> One ‘brutal’ way could be to convert the decision tree rules into SQL and then use the SQL code. Or use the ruleset to make some kind of If then rules. Not very elegant I have to admit. [kn\_example\_decision\_tree.knwf](https://forum-cdn.knime.com/uploads/default/original/2X/1/1132014ad9feb823a8ee8e8d5c9ce19ad8c13ba2.knwf) (510.8 KB)

Also you could select different ‘flavours’ of SQL.  
 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/a/ab068a7084d3a08a48f3127fb4b426816fa2c61c.png)

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:30pm UTC](https://forum.knime.com/t/using-knime-model-in-any-software-or-making-software-with-it/11530/8 "2023-06-23T20:30:13Z")

</div>


