12

Is there a C# Library to generate a decision tree from a datatable and then use it to predict missing data?

I did some researches but did not find any C# library that can generate a decision tree from a set of data.

Any help is greatly appreciated

EDIT: For more elaboration:

Lets say I have a dataset of persons with their name, age, salary, marital status, work and vote ( who they are going to vote for in the elections).

I want to use this data to build a decision tree.

And then I have another dataset of persons but without the "vote" column. I need to use the Decision tree generated in order to predict the vote for the persons.

The decision tree should be like a series of tests on all the variables of a person to obtain a final prediction

Y2theZ
  • 10,162
  • 38
  • 131
  • 200
  • Please elaborate on what you're trying to accomplish. It is unclear, at least to me, what you are really looking for. – SimpleVar Jun 28 '12 at 04:19
  • 1
    I tried to elaborate more. But if you are unfamiliar with decision trees, i cannot explain more. Thanks – Y2theZ Jun 28 '12 at 04:24
  • Just go through the tree, checking if the person passes the current test, and going to the next child accordingly, eventually getting to the last node (after the last test), which means we are in the place that suits our person the most. Now we should have a child for every vote option, each also counting how many people that got to that path visited (vote to) - taking the one with the most votes is the most probably vote for that certain person. – SimpleVar Jun 28 '12 at 04:38
  • The problem is that the data setup can change. the user is able to generate his own dataset with completly different columns. Thanks – Y2theZ Jun 28 '12 at 09:31
  • Will the user also generate the tests, etc, that will be used when making a decision tree? – SimpleVar Jun 28 '12 at 10:27
  • the user will choose which columns will be used for making decision. Thanks – Y2theZ Jun 29 '12 at 12:38

1 Answers1

16

Have you looked at Accord.NET Framework? Here's some more information: Decision Trees in C#

Cesar
  • 2,059
  • 25
  • 30
Rush
  • 873
  • 11
  • 13
  • Thanks a lot mate. exactly what I needed. I will give you the 200 bouty in 18 hours (they don't allow to give it now) – Y2theZ Jun 30 '12 at 20:36
  • Perhaps I'm missing something, but it seems this doesn't predict continuous variables... – ren Mar 28 '13 at 19:53
  • Yes, it seems to be only working on categories, or am I also mistaken? – PiJei Sep 12 '18 at 15:56