TreeBagger Error function won't run with tables
古いコメントを表示
I want to use TreeBagger to generate several ensembles. One of the things I need to do to use them effectively is to be able to calculate the MSE. I have 17 variables, 2 of which are categorical, thus I generated the ensembles from data in a table. Here comes my problem. As soon as I run Error(tree, table, ynew), I get the following error message:
Error using CompactTreeBagger/predictAccum (line 1340)
Input matrix of predictor values must be numeric.
To double check that it wasn't something in my data I made another table from the fisheriris data, made a tree, and ran that. Still no dice. Using a table for the y data works fine, but anything not a regular table and I can't get error to work. Can anyone tell me what I'm doing wrong? Or offer an alternative way to measure the MSE for TreeBagger ensembles?
Example of commands that give me this error:
load fisheriris
foo = [array2table(meas),array2table(species)];
t = TreeBagger(5,foo(:,1:4),foo.species)
error(t,foo(:,1:4),foo.species);
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Classification Ensembles についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!