2010-03-31 110 views
0

該系統實現了一個遊戲「思考動物」。用決策樹邏輯實現程序

主要用途的情況是:

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#決策樹邏輯的時候..? 任何信息將是有用的。 謝謝

+3

這聽起來很像功課......是嗎? – 2010-03-31 21:52:23

+1

在你的「這是一隻熊」的例子問題中?如果答案爲「是」,會導致像「是北極熊嗎?」這樣的問題。或者會承擔系統的最終答案? – nategoose 2010-03-31 22:05:56

+0

這聽起來像你試圖重新實現20q.net。 – Cerin 2010-07-15 13:16:04

回答

1

如前所述,決策樹生成算法就是您想要使用的算法。但是,由於系統會在每次與用戶進行「會話」之後逐步「更新」自己,因此您可能需要使用incremental decision tree算法,因此不必每次都運行一次較長的批量更新。

2

你想要做的事情絕對不是微不足道的。至於決策算法你看看C4.5?我無法在C#中找到它的實現,所以你可能會自己做。 ID3也可能適合你。

Google b-tree for SQL Server的實現中存在大量信息,但實際實現可能在很大程度上取決於您的決策樹實現。

祝你好運!