用决策树逻辑实现程序

时间:2010-03-31 21:24:25

标签: c# sql-server decision-tree

系统实现了一个游戏“思考动物”。

主要用例是:

1.  System offers user to think about any animal and the system will try to guess it
2.  The system starts asking questions from the start of decision tree. Ex., “Question: It has fur?”, and provides possible answers – yes or no.
3.  If the user answers Yes, the system proceeds to these steps:
a.  System tries to guess animal that has that feature, ex. “My guess: Is it bear?” and provides with possible answers – yes or no.
b.  If the user answer is Yes, the system offers to think off another animal
4.  If the user answers is No, the system moves to No node in decision tree and moves to 2 step (and starts from asking from new node).
5.  If system runs out of nodes (i.e., empty yes or no node was reached):
a.   the system announces that it has given up, and ask user to enter:
i.  What animal he had in mind
ii. What is his characteristic feature
b.  User enters requested data
c.  The system creates a new node and links it to yes or no of last active node.

在MS SQL Server和C#中实现决策树逻辑时,我可以获得一些信息和一些示例。 任何信息都是有用的。 感谢

2 个答案:

答案 0 :(得分:2)

你要做的事绝对不是微不足道的。至于决策算法,您是否考虑过C4.5?我无法在C#中找到一个实现,因此您可以独立完成。 ID3也可能适合您。

SQL Server的Google b-tree实现有很多信息,但实际的实现可能在很大程度上取决于您的决策树实现。

祝你好运!

答案 1 :(得分:1)

正如已经提到的,决策树生成算法是您想要使用的。但是,由于您的系统希望在与用户的每次“会话”之后逐步“更新”自身,因此您可能希望使用incremental decision tree算法,因此您不必每次都运行长批量更新。