# Which methods or algorithms to develop a learning application?

I am creating a game application that will generate a new level based on the performance of the user in the previous level.
The application is regarding language improvement, to be precise. Suppose the user performed well in grammar-related questions and weak on vocabulary in a particular level. Then the new level generated will be more focused on improving the vocabulary of the user.
All the questions will be present in a database with tags related to sections or category that they belong to. What AI concepts can I use to develop an application mentioned above?

• You don't really need an AI to do all those things. Can you please elaborate on certain reasons why you will be needing AI algorithms instead of normal ones. Your application will only require certain degree of programming and data base skills. – Ugnes Apr 19 '17 at 20:14
• @Ugnes ,Any application on earth can have AI capabilities. – quintumnia Jul 13 '17 at 15:10
• I don't really understand what you're asking. You've identified a number of candidate approaches --> "machine learning , planning systems , reinforcement learning and case-based-reasoning", and one or more of those might be useful for the system you're building. But what exactly is it you want to know? – mindcrime Jul 13 '17 at 19:12
• @mindcrime The OP has a concept that needs to be narrowed down.And this question has received vague answers.Where were we? – quintumnia Sep 13 '17 at 18:40
• @Ugnes This question needs revision. – quintumnia Sep 13 '17 at 18:41

even though that's not really AI, the easiest way to do that would probably be to put coefficients on each question

e.g. your question would have something like

grammar=0.55
vocabulary=0.45
if(won){
success=-1
}else{
success=1
}


the lower the level, the less questions of this type will appear

at the end of the level, you sum each question times how much did the player succeed

player.level is a real number array

for each question{
player.level["grammar"]=player.level["grammar"]+question.grammar*question.success
player.level["vocabulary"]=player.level["vocabulary"]+question.vocabulary*question.success
}


then when you initialize the level, generate the questions according to the player's level choice is a random real number between 0 and sum of all player.level (offseted to be above 0)

for each player.level{
if choice>player.level{
choice=choice-player.level
}else{
return question_type=player.level.type
}
}


though a "true" AI can make the same or better choices of questions, it will probably be slower, and require more data than a simple algorithm like this one.

You could build a MLC(machine learning classifier) based on her/his answers and apply that to a large database of questions to see which type of questions will probably yield an incorrect answer.

And then provide those questions (Assuming one would learn more from working at her/his weaknesses) to provide a steeper learning curve, continuously adapting the MLC.

http://www.deeplearningbook.org/ Chapter 5, also findable on github, has a very clear and relatively simple explanation on how to build a basic MLC, and what the problems/critical issues/parameters in application could be/are.

• Could you please expand the acronym MLC at its first use? Using acronyms without expanding them can confuse people who aren't already familiar with the term, especially if the term is overloaded with multiple expansions. – mindcrime Aug 12 '17 at 18:54
• @mindcrime Thank you! I did. I'm fairly new with it myself so I should've known. – a.t. Aug 12 '17 at 19:40

You can implement a Reinforcement Learning agent with the following aspects:

## Action Space

An action of adding or removing a question of a certain category, e.g. Add a grammar question, remove a grammar question, add vocabulary question, etc.

$a&space;\in&space;\left&space;\{&space;a_{grammar}^{+},&space;a_{grammar}^{-},a_{vocab}^{+},a_{vocab}^{-},&space;\cdots&space;\right&space;\}$

## State Space

Using the Flow Model, you can build a vector of flow features per topic. such that each element in that vector is either challenging, normal, boring

$\phi^T&space;=&space;\left&space;(&space;\varphi^{(grammar)},&space;\varphi^{(vocab)},&space;\cdots&space;\right&space;)$

such that

$\varphi^{(i)}&space;\in&space;\left&space;\{&space;-1,&space;0,&space;+1&space;\right&space;\}$

where -1 is boring, 0 is just right, and +1 is challenging, or the other way around

then you flatten this vector into a scalar integer

$s&space;:&space;\mathbb{Z}^n&space;\mapsto&space;\mathbb{Z}$

where n is number of subjects, and Z is the set of integer numbers

## Reward Signal

Use a combination of:

• participation time
• player score
• distance from equilibrium

to define a reward signal. and make the model learn the optimal flow for this user.

$r_{t}&space;:&space;\left&space;(&space;\psi,&space;T_{participating},&space;\left&space;\|&space;\phi&space;-&space;\phi^{*}&space;\right&space;\|&space;\right&space;)&space;\mapsto&space;\mathbb{R}$

such that $\psi&space;\in&space;\mathbb{R}^n$ is user score in each subject and

$\left&space;\|&space;\phi&space;-&space;\phi^{*}&space;\right&space;\|&space;\in&space;\mathbb{R}$

is a distance function defining how far this user is from equilibrium in skills to learn

## Algorithm

using the above model, you can build a simple Q-Learning agent, trying to maximize the reward signal by picking the optimal action, in terms of adding and removing questions, or challenges of a certain subject.

and of course, the reward signal is a function of how long the player spends playing, how challenged or bored the player is, and how far the player is from the optimal learning goal

$Q_{s_t,a_t}&space;\leftarrow&space;Q_{s_t,a_t}&space;+&space;\alpha&space;\left&space;(&space;r_t&space;+&space;\gamma&space;v_{s_{t+1}}&space;-&space;Q_{s_t,&space;a_t}&space;\right&space;)$

where v is the value of a certain state, Q is the value of a state/action pair

Good luck

A simple decision tree would be suitable, and represents one of the easiest forms of AI. Don't over-complicate simple problems.

The simplest approach would likely run faster, and require less system resources, so, unless this project is designed as an entree into machine learning, that approach is way overkill for this simple problem.