Dan Steinberg's Blog
On Demand Introductory Videos
Download Now Instant Evaluation
Get Price Quote

How to Export TreeNet Plots to Other Software

An example of a partial dependency plot for a continuous predictor appears below.

For a categorical variable we obtain a bar chart such as:

Exporting TreeNet Plots

TreeNet Plots

There are times when users prefer to create their own versions of these plots and we occasionally receive tech support requests for a way to extract the numeric values from which the plots are generated. The answer is simple but in versions of SPM 6.6 and later you must use the command line to issue the command:

TRANSLATE LANGUAGE=PLOTS

You can issue this command from an SPM Notepad (the preferred way, see the image below) or directly from the command prompt in the classic output window.Below we used the File menu item to select New Notepad and then typed in the command.

Translate Language Plots

Following this with File…Submit Window executes the command and produces XML like details for all plots generated by the TreeNet run. You will want these details in a separate file; the translate output is intended for a programmer to manipulate but you could cut and paste details for some plots if you must. The header provides some general information and the first few lines appear first.

code1

GB2000.xls-Zipped

Further down in the file you will find details for each plot. Below we show the first few lines for the continuous variable plot displayed above.

0.2048,-0.144002,2
1.3309,-0.320368,1
-0.6008,0.231729,2
-0.3388,0.104209,2
0.2048,-0.144002,1
-1.3102,0.564092,2
0.5635,-0.250871,1
0.2048,-0.144002,1
1.3309,-0.320368,1
-0.9312,0.49227,1
-1.639,0.642623,2
-0.3388,0.104209,2
-0.3388,0.104209,2
-0.9312,0.49227,2
0.5635,-0.250871,1
2.4423,-0.60254,1
0.2048,-0.144002,2
-0.2977,0.026098,1 

To plot these points in Excel, for example, you could just copy and paste them into a spreadsheet, sort them by the first column, and then request a scatter plot with a connecting line to obtain:

Plot points in Excel for TreeNet

For more than occasional exporting you will want to have a script written to process graph information in bulk and automatically. You could also produce your own smooths and extract other pertinent information. In one of our projects for modeling price sensitivity of products in a retail store we needed to process graphs for tens of thousands of products and we leveraged the TRANSLATE LANGUAGE=PLOTS for this purpose.

Educational Demos

[J#25:1603]

Tags: Blog, TreeNet