I am writing a helper learning algorithm in Java.
I ran into a math problem that I can probably solve, but since the processing will be difficult, I need an optimal solution.
Saying this, if someone knows an optimized library that will be absolutely awesome, but the language is Java, so you need to consider this.
The idea is pretty simple:
Objects will store a combination of variables such as ABDC, ACDE, DE, AE.
The maximum number of combinations will be based on how much I can run without slowing down the program, so theoretically we can say 100.
The decision process will generate one random variable per iteration. If the generated variable is part of one of the combinations, for example. "A", which is part of ABDC and ACDE, will increase the propensity for C and B (or any next letter in a stored combination).
To make things clearer, suppose that βA,β βB,β βC,β βD,β and βEβ are the only possible variables. In truth, it will be more than 12 or 14, but this maximum will also depend on how much I can process without delay.
Since there are five possible variables, it will generate a weighted 1/5 random throw for the first iteration. If this roll turns out to be βAβ, then at the next iteration βBβ and βCβ there will now be 2/5 inclinations instead of 1/5.
If the next iteration was to generate βBβ, the propensity βDβ would increase to 3/5. Note: the ratio is exponential; realistic, it will not be 1/5, but a slight increase, like 10%, that there will be a snowball, to say 50%, if it reaches the 4th variable in the sequence.
Now, in Java, I can probably achieve this functionality by tracking all saved combinations for each object. I thought that by distributing the tracking process in small steps at each iteration, it should not be too slow.
Another solution will display all possible combinations and their potential inclinations. This, of course, will simply require a search function, but it also presents problems when calculating all the features and storing somewhere, possibly in a file.
It has been suggested that I should use the Markov model and / or library, although I am not very good at this math.
How to quickly calculate this process in Java?
,
Example β>
Only one ABC sequence.
For three numbers, the odds start equal, so it will look something like rand (1,3)
If A is the result, we increase the probability of B because it is the next letter in the sequence. Let's say we doubled it.
So now the odds are: A = 1/4, C = 1/4, B = 2/4
The function will now look like rand (1,4), where results 3 and 4 represent option B.
If the next result is B, we want to increase the probability of C, because it is the next character in the sequence, but twice as much as the last time (exponentially).
Most likely, now something like: A = 1/6, C = 1/6, B = 4/6
Now the rand (1/6) function, where the values ββ3, 4, 5, 6 represent C.