The right model dilemma!
In the previous section, we ran five classification models for the Hypothyroid
dataset. Here, the task is to repeat the exercise for four other datasets. It would be a very laborious task to change the code in the appropriate places and repeat the exercise four times over. Thus, to circumvent this problem, we will create a new function referred to as Multiple_Model_Fit
. This function will take four arguments: formula
, train
, testX
, and testY
. The four arguments have already been set up for each of the five datasets. The function is then set up in a way that generalizes the steps of the previous section for each of the five models.
The function proceeds to create a matrix whose first column consists of the model name, while ...
Get Hands-On Ensemble Learning with R now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.