Boosted Tree
Boosted Tree using Random Reset
Summary: Opens a data table, sets a random seed, and defines a boosted tree model with specified response and predictor variables, validation portion, method, splits per tree, number of layers, learning rate, and executes the model.
Code:
// Boosted Tree of Banding?
// Open data table
dt = Open("data_table.jmp");
// Boosted Tree of Banding?
Random Reset( 123 );
Boosted Tree(
Y( :Banding? ),
X(
:grain screened,
:proof on ctd ink, :blade mfg,
:paper type, :ink type,
:direct steam, :solvent type,
:type on cylinder, :press type,
:unit number, :cylinder size,
:paper mill location,
:plating tank, :proof cut,
:viscosity, :caliper,
:ink temperature, :humidity,
:roughness, :blade pressure,
:varnish pct, :press speed,
:ink pct, :solvent pct,
:ESA Voltage, :ESA Amperage, :wax,
:hardener, :roller durometer,
:current density,
:anode space ratio,
:chrome content
),
Validation Portion( 0.2 ),
Method( "Boosted Tree" ),
Splits per Tree( 3 ),
Number of Layers( 41 ),
Learning Rate( 0.1 ),
Go
);
Code Explanation:
- Open data table.
- Set random seed.
- Define boosted tree model.
- Specify response variable.
- List predictor variables.
- Set validation portion.
- Choose boosting method.
- Define splits per tree.
- Set number of layers.
- Specify learning rate.
- Execute model.
Example 1
Summary: Fits a boosted tree model to predict percent body fat using multiple predictor variables, with validation and specified parameters for splits per tree, number of layers, and learning rate.
Code:
// Boosted Tree
// Open data table
dt = Open("data_table.jmp");
// Boosted Tree
Boosted Tree(
Y( :Percent body fat ),
X(
:"Age (years)"n, :"Weight (lbs)"n,
:"Height (inches)"n,
:"Neck circumference (cm)"n,
:"Chest circumference (cm)"n,
:"Abdomen circumference (cm)"n,
:"Hip circumference (cm)"n,
:"Thigh circumference (cm)"n,
:"Knee circumference (cm)"n,
:"Ankle circumference (cm)"n,
:
"Biceps (extended) circumference (cm)"n,
:"Forearm circumference (cm)"n,
:"Wrist circumference (cm)"n
),
Validation( :Validation ),
Method( "Boosted Tree" ),
Splits per Tree( 3 ),
Number of Layers( 30 ),
Learning Rate( 0.1 ),
Go
);
Code Explanation:
- Open table.
- Define model variables.
- Specify response variable.
- List predictor variables.
- Set validation method.
- Choose model type.
- Configure splits per tree.
- Set number of layers.
- Define learning rate.
- Execute analysis.
Example 2
Summary: Runs a Boosted Tree analysis to predict Y Binary, utilizing a local data filter on the Age column and generating a report with column contributions, lift curves, and overall statistics.
Code:
dt2 = Open("data_table.jmp");
BoostedTree_LDF2 = dt2 << Boosted Tree(
Y( :Y Binary ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Set Random Seed( 12345 ),
Multithreading( 0 ),
Method( "Boosted Tree" ),
Column Contributions( 1 ),
Lift Curve( 1 ),
Splits per Tree( 4 ),
Number of Layers( 29 ),
Learning Rate( 0.08 ),
Go,
SendToReport(
Dispatch( {}, "Specifications", OutlineBox, {Close( 1 )} ),
Dispatch( {}, "Overall Statistics", OutlineBox, {Close( 1 )} ),
Dispatch( {"Overall Statistics"}, "Confusion Matrix", OutlineBox, {Close( 1 )} ),
Dispatch( {"Lift Curve on Training Data"}, "Partition Lift Curve", FrameBox, {Background Color( 70 )} ),
Dispatch( {"Lift Curve on Validation Data"}, "Partition Lift Curve", FrameBox, {Background Color( 70 )} )
)
);
BoostedTree_LDF2 << Local Data Filter(
Add Filter(
columns( :Age ),
Modeling Type( :Age, Nominal ),
Where( :Age == {41, 42, 43, 44, 45, 46, 47, 48, 49} ),
Display( :Age, N Items( 15 ), Find( Set Text( "" ) ) )
)
);
ColumnContribs = Report( BoostedTree_LDF2 )[Outline Box( "Boosted Tree for Y Binary" )][Outline Box( "Column Contributions" )][
Table Box( 1 )] << Make Into Data Table;
vals2 = ColumnContribs << get as matrix;
text2 = (Report( BoostedTree_LDF2 ) << Parent)[Outline Box( 1 )][Text Box( 1 )] << Get Text;
Code Explanation:
- Open data table;
- Run Boosted Tree analysis.
- Specify response variable.
- Select predictor variables.
- Use validation column.
- Set random seed.
- Disable multithreading.
- Choose Boosted Tree method.
- Enable column contributions.
- Enable lift curve.
- Set splits per tree.
- Define number of layers.
- Set learning rate.
- Generate report.
- Close specifications section.
- Close overall statistics section.
- Close confusion matrix.
- Change lift curve background color.
- Change validation lift curve background color.
- Add local data filter.
- Filter Age column.
- Set Age as nominal.
- Define Age filter conditions.
- Display Age filter.
- Extract column contributions.
- Convert to matrix.
- Extract model text.
Example 3
Summary: Creates and analyzes boosted tree models for body fat prediction, extracting overall statistics reports and converting them to matrices.
Code:
Open("data_table.jmp");
obj1 = Boosted Tree(
Y( :Y ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Learning Rate( 0.08 ),
Go
);
rpt1 = obj1 << report;
fit1 = rpt1["Overall Statistics"][Table Box( 1 )] << get as matrix;
obj2 = obj1 << Redo analysis( 1 );
rpt2 = obj2 << report;
fit2 = rpt2["Overall Statistics"][Table Box( 1 )] << get as matrix;
obj3 = Boosted Tree(
Y( :Y Binary ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Learning Rate( 0.08 ),
Go
);
rpt3 = obj3 << report;
fit3 = rpt3["Overall Statistics"][Table Box( 1 )] << get as matrix;
obj4 = obj3 << Redo analysis( 1 );
rpt4 = obj4 << report;
fit4 = rpt4["Overall Statistics"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table;
- Create first boosted tree model.
- Extract overall statistics report.
- Convert report to matrix.
- Redo first analysis.
- Extract new report.
- Convert new report to matrix.
- Create second boosted tree model.
- Extract overall statistics report.
- Convert report to matrix.
Example 4
Summary: Fits a boosted tree model to predict body fat percentage using a specified set of predictor variables and validation column, generating cumulative details and saving them in matrix format.
Code:
dt = Open("data_table.jmp");
obj = dt << Boosted Tree(
Y( :Y ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Go
);
rpt = obj << report;
b saved1 = rpt["Cumulative Details"][Table Box( 1 )] << get as matrix;
tmp = obj << Save Cumulative Details;
saved1 = tmp << get as matrix;
Code Explanation:
- Open data table;
- Create Boosted Tree model.
- Set response variable Y.
- Define predictor variables.
- Use validation column.
- Run the model.
- Generate model report.
- Extract cumulative details table.
- Save cumulative details.
- Convert to matrix format.
Boosted Tree using Model Screening
Example 1
Summary: Runs a comprehensive model screening analysis to identify the most relevant predictors for a response variable, utilizing K-Fold cross-validation and various machine learning methods.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Model Screening(
Y( :Y ),
X( :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
DiBPscriminant( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 ),
K Fold Crossvalidation( 1 ),
K for K Fold( 3 ),
Set Random Seed( 123 ),
By( :Gender ),
Group Options( Return Group )
);
obj1 << Relaunch Analysis;
obj2 = dt << Fit Model(
Y( :Y, :BMI ),
Effects( :LDL, :HDL, :TCH, :LTG, :Glucose ),
By( :Gender ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run,
Group Options( Return Group )
);
Code Explanation:
- Open data table;
- Launch model screening analysis.
- Set response variable Y.
- Include multiple predictor variables.
- Disable various machine learning methods.
- Enable K-Fold cross-validation.
- Set K to 3.
- Set random seed to 123.
- Group by gender.
- Relaunch analysis.
- Launch fit model analysis.
- Set response variables Y and BMI.
- Include selected effects.
- Group by gender.
- Use standard least squares personality.
- Request minimal report.
- Run the analysis.
Example 2
Summary: Model screening and fitting of a standard least squares model to predict Y using multiple predictor variables, with K-fold cross-validation and grouping by Gender.
Code:
dt = Open("data_table.jmp");
obj1 = dt << Model Screening(
Y( :Y ),
X( :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
DiBPscriminant( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 ),
K Fold Crossvalidation( 1 ),
K for K Fold( 3 ),
Set Random Seed( 123 ),
By( :Gender ),
Group Options( Return Group )
);
obj1 << Relaunch Analysis;
obj2 = dt << Fit Model(
Y( :Y, :BMI ),
Effects( :LDL, :HDL, :TCH, :LTG, :Glucose ),
By( :Gender ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run,
Group Options( Return Group )
);
obj2 << Relaunch Analysis;
Code Explanation:
- Open data table;
- Perform model screening.
- Specify response variable Y.
- Include multiple predictor variables.
- Disable various modeling methods.
- Enable K-fold cross-validation.
- Set K to 3.
- Fix random seed to 123.
- Group by Gender.
- Relaunch analysis.
- Fit standard least squares model.
- Specify two response variables.
- Include selected effects.
- Group by Gender.
- Use standard least squares personality.
- Request minimal report.
- Run the model.
- Relaunch analysis.
Example 3
Summary: Performs a model screening process using the JMP Model Screening platform, configuring multiple X variables and validation for decision threshold analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Model Screening(
Y( :Y Binary ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
Discriminant( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 ),
Decision Threshold( 1 ),
);
rpt = obj << report;
test1 = rpt["Decision Thresholds"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table;
- Launch Model Screening platform.
- Set Y variable as binary.
- Include multiple X variables.
- Enable validation.
- Disable Decision Tree.
- Disable Bootstrap Forest.
- Disable Boosted Tree.
- Disable K Nearest Neighbors.
- Disable Neural network.
- Disable Support Vector Machines.
- Disable Discriminant analysis.
- Disable Fit Least Squares.
- Disable Fit Stepwise.
- Disable Logistic Regression.
- Set decision threshold to 1.
- Retrieve report object.
- Extract Decision Thresholds table.
- Convert table to matrix.
Example 4
Summary: Process of running two Model Screening scripts with specified models, decision thresholds, and profit matrices to generate reports and extract decision threshold matrices.
Code:
Open("data_table.jmp");
obj1 = Model Screening(
Y( :Y Binary ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Set Random Seed( 3458 ),
Decision Tree( 1 ),
Bootstrap Forest( 1 ),
Boosted Tree( 1 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
Discriminant( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 1 ),
Generalized Regression( 0 ),
Decision Threshold( 1, Set Probability Threshold( 0.3 ) )
);
rpt1 = obj1 << report;
mtrx1 = rpt1["Decision Thresholds"][Table Box( 1 )] << get as matrix;
obj2 = Model Screening(
Y( :Y Binary ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Set Random Seed( 3458 ),
Decision Tree( 1 ),
Bootstrap Forest( 1 ),
Boosted Tree( 1 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
Discriminant( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 1 ),
Generalized Regression( 0 ),
Specify Profit Matrix( [0 -1, -0.428571428571429 0, . .], "Low", "High", "Undecided" ),
Show Profit( 1 ),
Decision Threshold( 1 )
);
rpt2 = obj2 << report;
mtrx2 = rpt2["Decision Thresholds"][Table Box( 1 )] << get as matrix;
Code Explanation:
- Open data table;
- Run Model Screening with specified models.
- Set random seed for reproducibility.
- Include Decision Tree, Bootstrap Forest, Boosted Tree, Logistic Regression.
- Exclude other models.
- Set decision threshold probability.
- Generate report from first model screening.
- Extract matrix from decision thresholds.
- Run second Model Screening with profit matrix.
- Generate report from second model screening.
- Extract matrix from decision thresholds.
Boosted Tree using Set Modeling Type
Summary: Runs a Boosted Tree analysis to predict BAD using 12 predictors, including LOAN, MORTDUE, VALUE, REASON, JOB, YOJ, DEROG, DELINQ, CLAGE, NINQ, CLNO, and DEBTINC.
Code:
dt = Open("data_table.jmp");
dt:DEROG << Set Modeling Type( "nominal" );
dt:DELINQ << Set Modeling Type( "nominal" );
Boosted Tree(
Y( :BAD ),
X( :LOAN, :MORTDUE, :VALUE, :REASON, :JOB, :YOJ, :DEROG, :DELINQ, :CLAGE, :NINQ, :CLNO, :DEBTINC ),
Validation( :Validation ),
Missing Value Order( Low( :MORTDUE, :YOJ, :NINQ, :CLNO, :DEBTINC ), High( :VALUE, :CLAGE ) ),
Method( "Boosted Tree" ),
Splits per Tree( 15 ),
Number of Layers( 200 ),
Learning Rate( 0.128 ),
Go,
Profiler(
1,
Arrange in Rows( 7 ),
Term Value(
LOAN( 18608, Lock( 0 ), Show( 1 ) ),
MORTDUE( 73760, Lock( 0 ), Show( 1 ) ),
VALUE( 101780, Lock( 0 ), Show( 1 ) ),
REASON( "", Lock( 0 ), Show( 1 ) ),
JOB( "", Lock( 0 ), Show( 1 ) ),
YOJ( 8.922, Lock( 0 ), Show( 1 ) ),
DEROG( ., Lock( 0 ), Show( 1 ) ),
DELINQ( ., Lock( 0 ), Show( 1 ) ),
CLAGE( 179.8, Lock( 0 ), Show( 1 ) ),
NINQ( 1.186, Lock( 0 ), Show( 1 ) ),
CLNO( 21.296, Lock( 0 ), Show( 1 ) ),
DEBTINC( 33.78, Lock( 0 ), Show( 1 ) )
)
)
);
Code Explanation:
- Open data table;
- Set DEROG as nominal.
- Set DELINQ as nominal.
- Run Boosted Tree analysis.
- Specify BAD as response variable.
- Include 12 predictors.
- Use Validation column for validation.
- Set missing value order.
- Configure Boosted Tree method.
- Generate Profiler with specific settings.
Boosted Tree using If
Example 1
Summary: Performs a Model Screening analysis in JMP Pro, filtering data and extracting summary statistics for a specific response variable.
Code:
If( JMP Product Name() == "Pro",
dt = Open("data_table.jmp");
ModelScreening_LDF = dt << Model Screening(
Y( :Y ),
X( :Age, :Gender, :BMI ),
Validation( :Validation ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
Discriminant( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 ),
SendToReport( Dispatch( {"Model Screening for Y"}, "Details", OutlineBox, {Close( 0 )} ) )
);
ModelScreening_LDF << Local Data Filter(
Add Filter(
columns( :Age ),
Modeling Type( :Age, Nominal ),
Where( :Age == 60 ),
Display( :Age, N Items( 15 ), Find( Set Text( "" ) ) ),
Order By Count( :Age )
)
);
SummaryOfFit = Report( ModelScreening_LDF )[Outline Box( "Model Screening for Y" )][Outline Box( "Details" )][
Outline Box( "Response Y" )][Outline Box( "Summary of Fit" )][Table Box( 1 )] << Make Into Data Table;
vals1 = SummaryOfFit << Get as Matrix;
GenRegSummary = Report( ModelScreening_LDF )[Outline Box( "Model Screening for Y" )][Outline Box( "Details" )][
Outline Box( "Generalized Regression for Y" )][Outline Box( "Normal Lasso with Validation Column" )][Outline Box( "Model Summary" )][
Table Box( 2 )] << Make Into Data Table;
vals2 = GenRegSummary << Get as matrix;
text1 = (Report( ModelScreening_LDF ) << Parent)[Outline Box( 1 )][Text Box( 1 )] << Get Text;
Close( SummaryOfFit, nosave );
Close( GenRegSummary, nosave );
Close( dt, nosave );
);
Code Explanation:
- Check if JMP version is Pro.
- Open data table;
- Run Model Screening analysis.
- Disable all models except Linear.
- Close Details section in report.
- Apply local data filter on Age.
- Extract Summary of Fit data.
- Convert Summary of Fit to matrix.
- Extract Generalized Regression data.
- Convert Generalized Regression to matrix.
- Retrieve text from report.
- Close Summary of Fit table.
- Close Generalized Regression table.
- Close original dataset.
Example 2
Summary: Fits and publishes multiple models, including Nominal Logistic, Boosted Tree, and Neural Network, in JMP Pro.
Code:
If( JMP Product Name() == "Pro",
dt1 = Open("data_table.jmp");
fd1 = Formula Depot();
objL = dt1 << Fit Model(
Y( :sex ),
Effects( :height, :weight ),
Personality( "Nominal Logistic" ),
Run( Publish Probability Formulas )
);
objL << Close Window;
fd1 << Dispatch( {"Formula Scripts", "Fit Nominal Logistic - sex"}, "", TextEditBox,
{Set Text( "This is for testing - Fit Nominal Logistic" )}
);
objBT = dt1 << Boosted Tree(
Y( :sex ),
X( :height, :weight ),
Splits per Tree( 2 ),
Number of Layers( 1 ),
Learning Rate( 0.1 ),
Go,
Publish Prediction Formula
);
objBT << Close Window;
fd1 << Dispatch( {"Formula Scripts", "Boosted Tree - sex"}, "", TextEditBox, {Set Text( "This is for testing - Boosted Tree" )} );
objNN = dt1 << Neural( Y( :sex ), X( :height, :weight ), Validation Method( "Holdback", 0.3333 ), Fit( NTanH( 1 ) ) );
objNN << Fit[1] << (Publish Prediction Formula);
objNN << Close Window;
fd1 << Dispatch( {"Formula Scripts", "Neural/Model NTanH(1) - Save Formulas - sex"}, "", TextEditBox,
{Set Text( "This is for testing - Neural Net" )}
);
rfd = fd1 << report;
fd_script = fd1 << Get Script;
Save Text File( "$TEMP\fd.jrp", Char( Name Expr( fd_script ) ) );
Close( dt1, NoSave );
fd1 << close window( 1 );
rfd = Open( "$TEMP\fd.jrp" );
rfd << close window( 1 );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table;
- Create Formula Depot.
- Fit Nominal Logistic model.
- Close logistic model window.
- Update Formula Depot script.
- Run Boosted Tree analysis.
- Close Boosted Tree window.
- Update Formula Depot script.
- Run Neural Network analysis.
- Close Neural Network window.
- Update Formula Depot script.
- Save Formula Depot report.
- Save Formula Depot script.
- Close data table.
- Close Formula Depot window.
- Reopen saved Formula Depot report.
- Close reopened Formula Depot window.
Example 3
Summary: Runs the fitting and comparison of multiple machine learning models, including neural networks, logistic regression, and boosted trees, in JMP Pro.
Code:
If( JMP Product Name() == "Pro",
dt1 = Open("data_table.jmp");
fd1 = Formula Depot();
objNN = dt1 << Neural( Y( :sex ), X( :height, :weight ), Validation Method( "Holdback", 0.3333 ), Fit( NTanH( 1 ) ) );
objNN << Fit[1] << (Publish Prediction Formula);
objNN << Close Window;
objL = dt1 << Fit Model(
Y( :sex ),
Effects( :height, :weight ),
Personality( "Nominal Logistic" ),
Run( Publish Probability Formulas )
);
objL << Close Window;
objBT = dt1 << Boosted Tree(
Y( :sex ),
X( :height, :weight ),
Splits per Tree( 2 ),
Number of Layers( 1 ),
Learning Rate( 0.1 ),
Go,
Publish Prediction Formula
);
objBT << Close Window;
fd1 << Profiler( Formulas( "Neural/Model NTanH(1) - Save Formulas - sex", "Fit Nominal Logistic - sex", "Boosted Tree - sex" ) );
fd1 << Model Comparison(
Formulas( "Neural/Model NTanH(1) - Save Formulas - sex", "Fit Nominal Logistic - sex", "Boosted Tree - sex" )
);
rfd = fd1 << report;
Close( dt1, no save );
fd1 << close window( 1 );
);
Code Explanation:
- Check if JMP version is Pro.
- Open data table;
- Create Formula Depot.
- Fit neural network model.
- Publish prediction formula for neural network.
- Close neural network window.
- Fit logistic regression model.
- Publish probability formulas for logistic regression.
- Close logistic regression window.
- Fit boosted tree model.
- Publish prediction formula for boosted tree.
- Close boosted tree window.
- Add models to profiler.
- Compare models.
- Get report from Formula Depot.
- Close dataset without saving.
- Close Formula Depot window.
Example 4
Summary: Process of modeling and predicting readiness using JMP Pro, enabling users to screen models, fit generalized regression models with ordinal logistic distribution, and validate results using AICc.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
dt:ready << Modeling Type( "Ordinal" );
obj1 = dt << Model Screening(
Y( :ready ),
X( :heat, :soak, :count ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
Discriminant( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 )
);
obj2 = dt << Fit Model(
Y( :ready ),
Effects( :heat, :soak, :count ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Ordinal Logistic" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( AICc ) ) ),
SendToReport( Dispatch( {}, "Model Launch", OutlineBox, {Close( 0 )} ) )
);
rpt1 = obj1 << report;
rpt2 = obj2 << report;
test1 = rpt1["Training"][Table Box( 1 )] << get as matrix;
test2 = rpt2["Model Summary"][Table Box( 2 )] << get as matrix;
rpt1["Training"][Table Box( 1 )] << Set Selected Rows( [1] );
obj1 << Save Prediction Formulas;
prob1 = (dt:"Prob[Not Ready]"n << get values) || (dt:"Prob[Ready]"n << get values);
obj2 << (Fit[1] << Save Prediction Formula);
prob2 = (dt:"Prob[Not Ready] 2"n << get values) || (dt:"Prob[Ready] 2"n << get values);
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro.
- Open data table;
- Set "ready" as Ordinal.
- Run Model Screening.
- Disable multiple models.
- Run Fit Model.
- Use Generalized Regression.
- Specify Ordinal Logistic distribution.
- Use Lasso estimation.
- Validate using AICc.
Example 5
Summary: Runs data analysis and modeling tasks, including boosted tree and bootstrap forest fitting, cumulative details reporting, and formula publishing.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Boosted Tree( Y( :sex ), X( :height, :weight ), Method( "Boosted Tree" ), Go );
obj << Profiler( 1, Append Settings to Table( 1 ) );
fd = Formula Depot();
pred1 = obj << Publish Prediction Formula;
fd << Profiler( Formulas( pred1 ) );
(Report( fd )["Prediction Profiler"] << get scriptable object) << Set to Data in Row( 41 );
obj << Save Prediction Formula( 1 );
probs = ((dt:"Prob(sex==M)"n << get values) || (dt:"Prob(sex==F)"n << get values))[41, 0];
Close( dt, no save );
fd << close window( 1 );
);
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj = dt << Bootstrap Forest(
Y( :Y ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Go
);
rpt = obj << report;
b saved1 = rpt["Cumulative Details"][Table Box( 1 )] << get as matrix;
tmp = obj << Save Cumulative Details;
saved1 = tmp << get as matrix;
Close( tmp, no save );
Close( dt, no save );
dt = Open("data_table.jmp");
obj = dt << Boosted Tree(
Y( :Y ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Go
);
rpt = obj << report;
b saved1 = rpt["Cumulative Details"][Table Box( 1 )] << get as matrix;
tmp = obj << Save Cumulative Details;
saved1 = tmp << get as matrix;
Close( tmp, no save );
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro is installed.
- Open data table;
- Fit Boosted Tree model on sex using height and weight.
- Create profiler for the model.
- Access Formula Depot.
- Publish prediction formula.
- Add formula to profiler.
- Set profiler to data row 41.
- Save prediction formula to dataset.
- Extract probabilities for row 41.
- Close "data_table.jmp" without saving.
- Close Formula Depot window.
- Check if JMP Pro is installed.
- Open data table;
- Fit Bootstrap Forest model on Y using specified variables.
- Retrieve cumulative details report.
- Save cumulative details to matrix.
- Close temporary dataset without saving.
- Close "Diabetes.jmp" without saving.
- Reopen data_table dataset
- Fit Boosted Tree model on Y using specified variables.
- Retrieve cumulative details report.
- Save cumulative details to matrix.
- Close temporary dataset without saving.
- Close "Diabetes.jmp" without saving.
Example 6
Summary: Performs a Model Screening analysis in JMP Pro, specifying the response variable and predictor variables, and generating a report with decision thresholds.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj = Model Screening(
Y( :Y Binary ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
Discriminant( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 1 ),
Decision Threshold( 1 )
);
rpt = obj << report;
test1 = Try( rpt["Model Screening for Y Binary"]["Decision Thresholds"] << get title, 0 );
Close( dt, no save );
);
Code Explanation:
- Check if JMP version is Pro.
- Open data table;
- Run Model Screening analysis.
- Set response variable as Y Binary.
- Specify predictor variables.
- Enable validation column.
- Disable Decision Tree.
- Disable Bootstrap Forest.
- Disable Boosted Tree.
- Disable Discriminant.
- Disable Fit Least Squares.
- Disable Fit Stepwise.
- Enable Logistic Regression.
- Enable Decision Threshold.
- Retrieve report.
- Attempt to get Decision Thresholds title.
- Close dataset without saving.
Example 7
Summary: Executes Model Screening with customized settings for Boosted Tree, Neural Network, Generalized Regression, and Support Vector Machines, while extracting model summary text.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj = Model Screening(
Y( :Y Binary ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
K Nearest Neighbors( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Fit Logistic( 0 ),
Discriminant( 0 ),
Boosted Tree( 1, {Number of Layers( 26 ), Learning Rate( 0.44 )} ),
Neural( 1, {NLinear( 2 ), N Boost( 17 )} ),
Generalized Regression( 1, {Estimation Method( Elastic Net ), Validation Method( BIC )} ),
Support Vector Machines( 1, {Kernel Function( "Linear" )} ),
);
rpt = obj << report;
label1 = rpt["Support Vector Machine Model 1"]["Model Summary"][String Col Box( 2 )] << get text;
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro.
- Open data table;
- Run Model Screening.
- Set binary outcome variable.
- Define predictor variables.
- Use validation column.
- Disable Decision Tree.
- Disable Bootstrap Forest.
- Disable K Nearest Neighbors.
- Disable Least Squares fit.
- Disable Stepwise fit.
- Disable Logistic fit.
- Disable Discriminant analysis.
- Enable Boosted Tree with settings.
- Enable Neural network with settings.
- Enable Generalized Regression with settings.
- Enable Support Vector Machines with settings.
- Extract model summary text.
- Close dataset without saving.
Example 8
Summary: Runs Model Screening analysis in JMP Pro, performing neural network modeling and extracting mean -log p values from the report.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj = Model Screening(
Y( :Y Binary ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Set Random Seed( 12345 ),
Neural( 1 ),
Decision Tree( 1 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Support Vector Machines( 0 ),
Discriminant( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 ),
Generalized Regression( 0 ),
);
rpt = obj << report;
stat2 = rpt[Outline Box( 17 )][Number Col Box( "Mean -log p" )] << get as matrix;
tmp = rpt["Details"]["Neural"]["Model NTanH(3)NBoost(20)"] << get scriptable object;
tmp << Save Fast Formulas;
obj2 = Model Comparison( Group( :Validation ) );
rpt2 = obj2 << report;
b stat = rpt2["Measures of Fit for Y Binary"][Number Col Box( "Mean -log p" )] << get as matrix;
Close( dt, no save );
);
Code Explanation:
- Check if JMP version is Pro.
- Open data table;
- Perform Model Screening analysis.
- Set response variable as binary.
- Specify predictor variables.
- Use validation column.
- Set random seed for reproducibility.
- Enable Neural network model.
- Disable other predictive models.
- Extract mean -log p values from report.
- Save fast formulas for neural model.
- Compare models using validation group.
- Extract mean -log p values from comparison report.
- Close dataset without saving.
Example 9
Summary: Model screening and fitting using Partial Least Squares regression in JMP Pro, generating reports and extracting performance metrics for training and validation datasets.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj1 = Model Screening(
Y( :Y ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Fit Least Squares( 0 ),
Partial Least Squares( 1 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
Decision Tree( 0 ),
Neural( 0 ),
Fit Stepwise( 0 ),
Generalized Regression( 0 ),
K Nearest Neighbors( 0 ),
Support Vector Machines( 0 )
);
rpt1 = obj1 << report;
test1 training = rpt1["Training"][Table Box( 1 )] << get as matrix;
test1 validation = rpt1["Validation"][Table Box( 1 )] << get as matrix;
obj2 = Fit Model(
Validation( :Validation ),
Y( :Y ),
Effects( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
No Intercept( 1 ),
Center Polynomials( 0 ),
Personality( "Partial Least Squares" ),
Run( Initial Number of Factors( 11 ), Fit( Method( NIPALS ) ) ),
);
test2 = obj2 << (Fit[1] << get measures( 1 ));
test2 training = J( 1, 3, test2["Y"]["Training"]["N"] ) || test2["Y"]["Training"]["RSquare"] || test2["Y"]["Training"]["RASE"];
test2 validation = J( 1, 3, test2["Y"]["Validation"]["N"] ) || test2["Y"]["Validation"]["RSquare"] || test2["Y"]["Validation"]["RASE"];
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro version.
- Open data table;
- Run Model Screening.
- Define response variable Y.
- Define predictor variables.
- Set validation column.
- Enable multiple modeling methods.
- Generate model screening report.
- Extract training data from report.
- Extract validation data from report.
- Fit model using Partial Least Squares.
- Retrieve model fit measures.
- Format training performance metrics.
- Format validation performance metrics.
- Close dataset without saving.
Example 10
Summary: Performs a model screening process in JMP Pro, enabling the selection of Generalized Regression and Partial Least Squares models with Nested Crossvalidation.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj1 = dt << Model Screening(
Y( :Y ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
Discriminant( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 ),
Generalized Regression( 1 ),
Partial Least Squares( 1 ),
Nested Crossvalidation( 1 )
);
rpt1 = obj1 << report;
method = rpt1["Summary Across the Folds"][String Col Box( 1 )] << get text;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro version.
- Open data table;
- Launch Model Screening platform.
- Set response variable.
- Define predictor variables.
- Disable Decision Tree.
- Disable Bootstrap Forest.
- Disable Boosted Tree.
- Disable K Nearest Neighbors.
- Disable Neural network.
- Disable Support Vector Machines.
- Disable Discriminant analysis.
- Disable Fit Least Squares.
- Disable Fit Stepwise.
- Disable Logistic Regression.
- Enable Generalized Regression.
- Enable Partial Least Squares.
- Enable Nested Crossvalidation.
- Retrieve model summary report.
- Extract method names.
- Close dataset without saving.
Example 11
Summary: Runs the Model Screening platform in JMP Pro to configure and generate a report, utilizing multiple predictor variables and validation settings.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj = dt << Model Screening(
Y( :Y ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Validation( :Validation ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
K Nearest Neighbors( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Fit Logistic( 0 ),
Discriminant( 0 ),
Support Vector Machines( 0 ),
Boosted Tree( 1, {Number of Layers( 20 ), Learning Rate( 0.4 )} ),
Neural( 1, {NLinear( 2 ), N Boost( 15 )} ),
Generalized Regression( 1, {Estimation Method( Elastic Net ), Validation Method( BIC )} ),
);
rpt = obj << report;
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro is installed.
- Open data table;
- Launch Model Screening platform.
- Set response variable Y.
- Add multiple predictor variables.
- Enable validation column.
- Disable Decision Tree.
- Disable Bootstrap Forest.
- Disable K Nearest Neighbors.
- Disable Fit Least Squares.
- Disable Fit Stepwise.
- Disable Fit Logistic.
- Disable Discriminant.
- Disable Support Vector Machines.
- Enable Boosted Tree with settings.
- Enable Neural network with settings.
- Enable Generalized Regression with settings.
- Generate model report.
- Close dataset without saving.
Example 12
Summary: Performs a model screening process in JMP Pro, utilizing Boosted Trees and Logistic Regression to analyze the relationship between multiple predictor variables and a binary response variable.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj = dt << Model Screening(
Y( :Y Binary ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
Boosted Tree( 1 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 1 ),
Generalized Regression( 0 ),
Nested Crossvalidation( 1 ),
K for Nested( 2 ),
L for Nested( 3 ),
Set Random Seed( 12345 ),
);
obj << Decision Threshold( 1 );
obj << Decision Threshold( 1 );
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro version.
- Open data table;
- Launch Model Screening platform.
- Set response variable (Y Binary).
- Include multiple predictor variables.
- Disable Decision Tree.
- Disable Bootstrap Forest.
- Enable Boosted Tree.
- Disable K Nearest Neighbors.
- Disable Neural networks.
- Disable Support Vector Machines.
- Disable Fit Least Squares.
- Disable Fit Stepwise.
- Enable Logistic Regression.
- Disable Generalized Regression.
- Enable Nested Crossvalidation.
- Set K for Nested to 2.
- Set L for Nested to 3.
- Set random seed to 12345.
- Set decision threshold to 1.
- Set decision threshold to 1 again.
- Close dataset without saving.
Example 13
Summary: Performs a Model Screening analysis in JMP Pro, utilizing various algorithms and settings to evaluate the performance of different models.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj1 = dt << Model Screening(
Y( :Y ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
Fit Least Squares( 1 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 ),
Generalized Regression( 0 ),
Partial Least Squares( 1 ),
Nested Crossvalidation( 1 ),
K for Nested( 2 ),
L for Nested( 2 ),
Set Random Seed( 888 ),
);
rpt1 = obj1 << report;
summary1 = rpt1["Summary Across the Folds"][Table Box( 1 )] << get as matrix;
Close( dt, no save );
);
Code Explanation:
- Check if JMP is Pro version.
- Open data table;
- Run Model Screening.
- Set response variable.
- Specify predictor variables.
- Disable Decision Tree.
- Disable Bootstrap Forest.
- Disable Boosted Tree.
- Disable K Nearest Neighbors.
- Disable Neural Network.
- Disable Support Vector Machines.
- Enable Fit Least Squares.
- Disable Fit Stepwise.
- Disable Logistic Regression.
- Disable Generalized Regression.
- Enable Partial Least Squares.
- Enable Nested Crossvalidation.
- Set K for Nested.
- Set L for Nested.
- Set random seed.
- Retrieve report.
- Extract summary matrix.
- Close dataset without saving.
Example 14
Summary: Performs a Model Screening analysis in JMP Pro, including logistic regression and generalized regression models, with decision threshold option enabled.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
dt:sex << Set Property( "Profit Matrix", {[0 - 1, -0.428571428571429 0, . .], {"F", "M", "Undecided"}} );
obj1 = Model Screening(
Y( :sex ),
X( :height, :weight ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Neural( 0 ),
Support Vector Machines( 0 ),
Discriminant( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 1 ),
Generalized Regression( 1 ),
Decision Threshold( 1 )
);
rpt1 = obj1 << report;
label1 = rpt1["Decision Thresholds"]["Training"][Text Box( 6 )] << get text;
prob1 = rpt1["Decision Thresholds"]["Training"][Number Edit Box( 1 )] << get;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro version.
- Open data_table data
- Set property for "sex" column.
- Run Model Screening analysis.
- Include logistic regression model.
- Include generalized regression model.
- Enable decision threshold option.
- Retrieve report from analysis.
- Extract decision threshold label.
- Extract decision threshold probability.
Example 15
Summary: Performs a Model Screening analysis in JMP Pro, utilizing Support Vector Machines and decision thresholding to evaluate predictive models.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj1 = dt << Model Screening(
Y( :BAD ),
X( :MORTDUE, :VALUE, :REASON, :JOB, :YOJ, :DEROG, :DELINQ ),
Validation( :Validation ),
Decision Tree( 0 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Discriminant( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 ),
Generalized Regression( 0 ),
Informative Missing( 1 ),
Set Random Seed( 123 ),
);
obj1 << Select Fit( "Training", Where( Method == "Support Vector Machines" ) );
obj1 << Decision Threshold( 1 );
obj2 = obj1 << Redo Analysis( 1 );
rpt1 = obj1 << report;
rpt2 = obj2 << report;
conf mtrx1 = rpt1["Decision Thresholds"]["Training"][Table Box( 1 )] << get as matrix;
conf mtrx2 = rpt2["Decision Thresholds"]["Training"][Table Box( 1 )] << get as matrix;
obj1 << Save Prediction Formulas( 1 );
mc1 = Model Comparison( Group( :Validation ) );
mc1 << Decision Threshold( 1 );
rpt3 = mc1 << report;
conf mtrx3 = rpt3["Decision Thresholds"]["Training"][Table Box( 1 )] << get as matrix;
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table.
- Run Model Screening analysis.
- Set Y variable to BAD.
- Include multiple X variables.
- Enable validation.
- Disable several modeling methods.
- Enable Informative Missing option.
- Set random seed to 123.
- Select Support Vector Machines fit.
- Set decision threshold to 1.
- Redo analysis with selected method.
- Extract first report.
- Extract second report.
- Get confusion matrix from first report.
- Get confusion matrix from second report.
- Save prediction formulas.
- Create Model Comparison object.
- Set decision threshold to 1 in comparison.
- Extract comparison report.
- Get confusion matrix from comparison report.
- Close data table without saving.
Example 16
Summary: Creates and compares two Boosted Tree models using log-transformed height as response, with sex, age, and weight as predictors, in JMP Pro.
Code:
If( Contains( JMP Product Name(), "Pro" ) > 0,
dt = Open("data_table.jmp");
obj1 = Boosted Tree(
Y( Transform Column( "Log height", Formula( Log( :height ) ) ), ),
X( :sex, :age, :weight ),
Set Random Seed( 345 ),
Go
);
obj1 << Save Residuals( 1 );
obj1 << Save Prediction Formula( 1 );
obj1 << Save Predicteds( 1 );
dt << New Column( "height mod", numeric, Formula( Log( :height ) ) );
obj2 = Boosted Tree( Y( :height mod ), X( :sex, :age, :weight ), Set Random Seed( 345 ), Go );
obj2 << Save Residuals( 1 );
obj2 << Save Prediction Formula( 1 );
obj2 << Save Predicteds( 1 );
Close( dt, no save );
);
Code Explanation:
- Check if JMP Pro is installed.
- Open data table.
- Create Boosted Tree model.
- Use log-transformed height as response.
- Include sex, age, weight as predictors.
- Set random seed for reproducibility.
- Run the model.
- Save residuals to data table.
- Save prediction formula to data table.
- Save predicted values to data table.
- Add log-transformed height column.
- Create second Boosted Tree model.
- Use new height column as response.
- Include same predictors.
- Set random seed for consistency.
- Run the second model.
- Save residuals for second model.
- Save prediction formula for second model.
- Save predicted values for second model.
- Close data table without saving.
Example 17
Summary: Executes a Boosted Tree model with custom Profiler settings and report generation in JMP Pro.
Code:
If( Contains( JMP Product Name(), "Pro" ),
dt = Open("data_table.jmp");
obj1 = dt << Boosted Tree(
Y( :sex ),
X( :height, :weight, :age ),
Go,
Profiler(
1,
Desirability Functions( 1 ),
:sex << Category Desirability( {"F", 0.8}, {"M", 0.4}, ),
Term Value( height( 62.55 ), weight( 105 ), age( 12 ) )
)
);
rpt1 = obj1 << report;
obj1 << Save Prediction Formula;
d1 = Parse( Substr( rpt1["Prediction Profiler"][AxisBox( 2 )] << get text, 13 ) );
obj2 = dt << Profiler(
Y( :"Prob(sex==M)"n, :"Prob(sex==F)"n ),
Profiler(
1,
Desirability Functions( 1 ),
:sex << Category Desirability( {"F", 0.8}, {"M", 0.4}, ),
Term Value( height( 62.55 ), weight( 105 ), age( 12 ) )
)
);
rpt2 = obj2 << report;
d2 = Parse( Substr( rpt2["Prediction Profiler"][AxisBox( 2 )] << get text, 13 ) );
Close( dt, no save );
);
Code Explanation:
- Check for JMP Pro.
- Open data table;
- Run Boosted Tree model.
- Configure Profiler settings.
- Generate model report.
- Save prediction formula.
- Extract prediction text.
- Run standard Profiler.
- Configure Profiler settings again.
- Generate second report.
Boosted Tree using Log Capture
Summary: Model screening and evaluation using K-Fold Crossvalidation, enabling Decision Trees and disabling other models.
Code:
dt = Open("data_table.jmp");
log1 = Log Capture(
obj1 = Model Screening(
Y( :Y ),
X( :Age, :Gender, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ),
K Fold Crossvalidation( 1 ),
K for K Fold( 23 ),
Neural( 0 ),
Decision Tree( 1 ),
Bootstrap Forest( 0 ),
Boosted Tree( 0 ),
K Nearest Neighbors( 0 ),
Support Vector Machines( 0 ),
Discriminant( 0 ),
Fit Least Squares( 0 ),
Fit Stepwise( 0 ),
Logistic Regression( 0 ),
Generalized Regression( 0 ),
)
);
Code Explanation:
- Open data table;
- Start log capture.
- Launch Model Screening.
- Set response variable Y.
- Define predictor variables.
- Enable K Fold Crossvalidation.
- Set K to 23.
- Disable Neural network.
- Enable Decision Tree.
- Disable other models.