Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: Transfer jmp model script to python?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Apr 30, 2019 7:15 AM
(4026 views)

Our team created a neural and ARMA model in JMP and now a customer wants to evauate these models in Python. Can anyone help or give advice how to transfer the jmp model scripts to python?

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

I am sorry about the lack of support for the deployment of our ARIMA models being a bottleneck for your project. This would make a good entry in the JMP Wish List.

Regarding the Python code generation for Neural Networks models: JMP Pro **14.2 **added support for mapping JSL linear algebra operators to NumPy, resulting in much smaller and faster scoring code. Unfortunately, the default publishing operation for Neural Networks doesn't take advantage of that feature, but you can still access it by taking the following steps:

1) Fit your Neural Network;

2) From the model LRT, instead of using "Publish Prediction Formula" - which would push the model directly to the Formula Depot - use "Save Fast Formulas". This will add a new Formula column to your data table named

"Predicted <VARIABLE NAME>".

It is the same basic model but it uses matrix multiplications in its calculations.

3) Back to the main menu, select Analyze > Predictive Modelling > Formula Depot

4) From the Formula Depot LRT, select the first option, "Add Formula from Column". Select the new formula column if necessary (it will be selected automatically if it is the only one available). This should add a new entry to the Formula Depot with the name

"Neural - <VARIABLE NAME>".

5) From the LRT of the new entry, select "Generate Python code"

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Transfer jmp model script to python?

The Formula Depot in JMP Pro will generate Python code from JMP models.

-Jeff

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Transfer jmp model script to python?

Unfortunately I don't have jmp pro version, any possibility with the regular 14.1 software?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Transfer jmp model script to python?

If you try to make your own, you might find the expression manipulation functions helpful for writing JSL that can study the JSL formula:

https://community.jmp.com/t5/Uncharted/Introspection/ba-p/28930

I just took a quick look at JMP's formula depot code that writes Python statements and decided there is more to it than I first imagined. @nascif_jmp

Craige

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Transfer jmp model script to python?

I would not advise using JSL introspection to manually convert these models to Python. Neural networks use primitives that you could in theory map to the corresponding Python operations (which is what the Formula Depot scoring code generation does behind the scenes) but they get very large and complex rather quickly, so if you make a mistake in your code it would be difficult to find where. Better to rely on JMP to make the conversion for you, though as Jeff pointed out, this is indeed a JMP Pro only feature.

ARIMA is more problematic as the generated model is not based in JSL primitives; there is nothing that can be mapped to Python operators. So even with a JMP Pro license you would not be able to the Formula Depot to generate Python code for it.

Here is more information and examples on the JMP scoring code generation capability:

https://community.jmp.com/t5/Discovery-Summit-2016/Scoring-Outside-the-Box/ta-p/22381

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Transfer jmp model script to python?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

I am sorry about the lack of support for the deployment of our ARIMA models being a bottleneck for your project. This would make a good entry in the JMP Wish List.

Regarding the Python code generation for Neural Networks models: JMP Pro **14.2 **added support for mapping JSL linear algebra operators to NumPy, resulting in much smaller and faster scoring code. Unfortunately, the default publishing operation for Neural Networks doesn't take advantage of that feature, but you can still access it by taking the following steps:

1) Fit your Neural Network;

2) From the model LRT, instead of using "Publish Prediction Formula" - which would push the model directly to the Formula Depot - use "Save Fast Formulas". This will add a new Formula column to your data table named

"Predicted <VARIABLE NAME>".

It is the same basic model but it uses matrix multiplications in its calculations.

3) Back to the main menu, select Analyze > Predictive Modelling > Formula Depot

4) From the Formula Depot LRT, select the first option, "Add Formula from Column". Select the new formula column if necessary (it will be selected automatically if it is the only one available). This should add a new entry to the Formula Depot with the name

"Neural - <VARIABLE NAME>".

5) From the LRT of the new entry, select "Generate Python code"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Transfer jmp model script to python?