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

- JMP User Community
- :
- Discussions
- :
- How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a ...

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

Highlighted
##
How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

Jun 11, 2020 7:20 AM
(848 views)

Missing formula with data with missing value trained by Partition model, how to convert JSL into a form that can be used in JMP formula.

`ab>=-14&P1>=174.1&EVk<34341 or Missing&xyz<214.98 or Missing&EVk<154 or Missing&P1>=1741`

into

` :ab >= -14 & :P1 >= 1741 & (:EVk < 154 | Is Missing( :EVk )) & (:xyz < 214.98 | Is Missing( :xyz )) `

Thanks!

16 REPLIES 16

Highlighted
##
Re: How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

Here "AB", "P1" and "EVk" are Partition multiple times.How do can keep only valid parameters?

And how do automatically turn

"EVk<154 or Missing"

into

":EVk<154 | is Missing(:EVk)"?

Highlighted
##
Re: How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

Just save the prediction formula as a column formula after selecting the partition model.

Learn it once, use it forever!

Highlighted
##
Re: How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

So if you save the fitted partition model, it IS a column formula.

Learn it once, use it forever!

Highlighted
##
Re: How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

Created:
Jun 11, 2020 7:40 AM
| Last Modified: Jun 11, 2020 7:44 AM
(832 views)
| Posted in reply to message from markbailey 06-11-2020

Thank markbailey!

But I have tried to copy the leaf label formula and calculate it as a normal formula, which is wrong.

For example:

`dt<<New Column("text",formula(:ab>=-14&:P1>=1741&:xyz<214.98 or Missing&:EVk<154 or Missing));dt<<run formulas;Column("text")<<deleteFormula;Wait(0);`

Highlighted
##
Re: How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

Created:
Jun 11, 2020 10:00 AM
| Last Modified: Jun 11, 2020 10:05 AM
(805 views)
| Posted in reply to message from lwx228 06-11-2020

Yes, that code is wrong. That code is not what is saved as a formula for the leaf labels. You incorrectly copied what you want from the formula and pasted the wrong code into your script.

Here is an example that copied the saved formula for the leaf labels verbatim and pasted it as the argument to the Formula() argument for the new column:

```
Names Default To Here( 1 );
// open an example
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// create a new column for character data and populate it with formula based on a
// previously saved formula for leaf labels.
dt << New Column( "Text",
Character,
Formula(
If( !Is Missing( :height ) & :height >= 63,
If( !Is Missing( :height ) & :height >= 67,
"height>=63&height>=67",
"height>=63&height<67"
),
"height<63"
)
)
);
```

Learn it once, use it forever!

Highlighted
##
Re: How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

yes.I also know that can use the "prediction formula" directly.But this prediction formula is so global, so large, and so complex that it is inconvenient to use it in other files.

The "leaf label formula" is accurate, but the leaf label formula produced automatically by the "Partition" model cannot be used directly.

So I transferred these leaf label formulas to Excel using VBA to automatically convert them into a form that can be used in JMP formulas.

But this operation will use the whole process of operation can not be fully automated.

Thank markbailey!

Highlighted
##
Re: How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

So I want to know how to use JSL to convert these leaf label formulas into the usable form of JMP formula() formu.

Highlighted
##
Re: How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

I think we're confused because the Leaf Label Formula column already has a formula behind it. You don't need to convert anything. Can you explain more clearly exactly the steps you want to do?

-Jeff

Highlighted
##
Re: How to use JSL to convert the Decision Tree Partition Leaf Label Formula into a form that can be used in JMP formula？

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

Created:
Jun 16, 2020 5:41 AM
| Last Modified: Jun 16, 2020 6:52 AM
(696 views)
| Posted in reply to message from Jeff_Perkinson 06-16-2020

Thank Jeff!

Since I got these leaf label formulas that were not used in the original file.

So I simply removed the formula from the leaf label formula column, got only the text, and lumped the text of the different leaf label formulas into a file.

These textual leaf label formulas are then used to calculate other data using JSL.So I have this problem of conversion.