Use the generated decision tree to predict new inputs

I want to use the accord.net environment to generate a decision tree from a dataset.

I read the manual at this link http://crsouza.blogspot.com/2012/01/decision-trees-in-c.html

I managed to generate a tree following it. However, how to use it to predict new entries?

what I mean, after creating the tree that I want to use (as an if-else statement, to find out the output of the new inputs)

indicated that I can convert it to an expression var expression = tree.ToExpression();, but how to use it?

Thanks for any help

+5
source share
1 answer

. var expression = tree.ToExpression(); :

var func = expression.Compile();

- , , . -

bool willPlayTennis = func(new double[] {1.0, 1.0, 1.0, 1.0}) == 1;

+4

All Articles