This command is available with the Predictive Analytics Module. Click here for more information about how to activate the module.
A team of researchers collects and publishes detailed information about factors that affect heart disease. Variables include age, sex, cholesterol levels, maximum heart rate, and more. This example is based on a public data set that gives detailed information about heart disease. The original data are from archive.ics.uci.edu.
The researchers want to find a model that makes the most accurate predictions that are possible. The researchers use Discover Best Model (Binary Response) to compare the predictive performance of 4 types of models: binary logistic regression, TreeNet®, Random Forests® and CART®. The researchers plan to further explore the type of model with the best predictive performance.
The Model Selection table compares the performance of the different types of models. The Random Forests® model has the minimum value of the average –loglikelihood. The results that follow are for the best Random Forests® model.
The Misclassification Rate vs Number of Trees Plot shows the entire curve over the number of trees grown. The misclassification rate is approximately 0.16.
The Model summary table shows that the average negative loglikelihood is approximately 0.39.
The Relative Variable Importance graph plots the predictors in order of their effect on model improvement when splits are made on a predictor over the sequence of trees. The most important predictor variable is Thal. If the contribution of the top predictor variable, Thal, is 100%, then the next important variable, Major Vessels, has a contribution of 98.9%. This means Major Vessels is 98.9% as important as Thal in this classification model.
The confusion matrix shows how well the model correctly separates the classes. In this example, the probability that an event is predicted correctly is approximately 87%. The probability that a nonevent is predicted correctly is approximately 81%.
The misclassification rate helps indicate whether the model will accurately predict new observations. For prediction of events, the out-of-bag misclassification error is approximately 13%. For the prediction of nonevents, the misclassification error is approximately 19%. Overall, the misclassification error for the test data is approximately 16%.
The area under the ROC curve for the Random Forests® model is approximately 0.90 for the out-of-bag data.
The researchers can look at results for other models from the search for the best model. For a TreeNet® model, you can select from a model that was part of the search or specify hyperparameters for a different model.
This analysis grows 300 trees and the optimal number of trees is 46. The model uses a learning rate of 0.1 and a subsample fraction of 0.5. The maximum number of terminal nodes per tree is 6.