It always amazed me how the Akinator app could guess a character by asking just several questions. So I wonder what kind of algorithm or method let it do that? Is there a name for that class of algorithms and where can I read more about them?
Yes, there is a name for these class of algorithms - it is called classification algorithms in the field of machine learning. Decision trees is one example for classification algorithm.
In this classification problem, the features for the algorithm are the answers to the question.
Deciding which question should be asked next can be done in various ways - for example by trying to maximize the predicted (or mean) entropy from the next question.
This game is sometimes known as 20 Questions. There are some questions on SO on it, e.g.:
Main characteristics of algorithm:
- Self-educating
- Mistakes-indulgence
- Intelligent system of next question choose
Akinator game algorithm model is called "Expert system based on Fuzzy logic".
And this is NOT Decision trees, because it's have no mistakes-indulgence.
I had wrote one some time ago on C#, you can find it by link: https://github.com/ukushu/AkinatorEngine
I don't know what exactly algorithm Akinator uses, but here I have put open-source an algorithm that achieves the same effect: https://github.com/srogatch/ProbQA
Basically we use a cube of N(Questions) times N(Answer Options) times N(Targets) , see https://github.com/srogatch/ProbQA/blob/master/ProbQA/PqaCore/CpuEngine.decl.h .
We train the cube by applying Bayesian formula with independence assumption, see https://github.com/srogatch/ProbQA/blob/master/ProbQA/PqaCore/CEEvalQsSubtaskConsider.cpp
Because the code is highly optimized for AVX2 and multi-threading, it may be hard to read. It may be easier to read the CUDA code for the same: https://github.com/srogatch/ProbQA/blob/master/ProbQA/PqaCore/CudaEngineGpu.cu
An application of this algorithm is also available as a website to recommend a game.
I think this is like an expert system, with B-Tree structure.
来源:https://stackoverflow.com/questions/13649646/what-kind-of-algorithm-is-behind-the-akinator-game