Question: We obtained a dataset Animal to develop two models: Model 1 and Model 2 , which are used to predict the value of Type. We

We obtained a dataset Animal to develop two models: Model1 and Model2, which are used to predict the value of Type. We have loaded the data to object Animal into software and compared the performance of the two models. Model outputs are shown as below. Based on the outputs, which of the statements is(are) true? > dim(Animal)[1]1000016> contrasts(Type) ReptileAmphibian 0Reptile 1> trainTree = sample(1:nrow(Animal), nrow(Animal)*0.7)> Animal.train = Animal[trainTree,]> Animal.test = Animal[-trainTree, ]> train.truevalue=Type[trainTree]> test.truevalue=Type[-trainTree]> Model1=randomForest(Type ~ ., data = Animal.train, mtry=4,importance=TRUE)> Model1.pred.train = predict(Model1,Animal.train)> mean(Model1.pred.train==train.truevalue)[1]0.90> Model1.pred.test= predict(Model1,Animal.test)> mean(Model1.pred.test==test.truevalue)[1]0.83> Model2=randomForest(Type ~ ., data = Animal.train, mtry=15,importance=TRUE)> Model2.pred.train = predict(Model2,Animal.train)> mean(Model2.pred.train==train.truevalue)[1]0.98> Model2.pred.test= predict(Model2,Animal.test)> mean(Model2.pred.test==test.truevalue)[1]0.81

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!