how can i implement a number prediction algorithm?
이전 댓글 표시
I have this procedure:
- I have 20 numbers, from 1 to 20.
- I choose 3 of these 20 numbers in the way that these number are not equal so i choose in a random way 3 not repeated numbers in this interval (A sort of extraction).
- I save these three numbers in a vector.
- I repeat the three previous point so after 50 times i have my origin number from 1 to 20 and a vector made of 50 rows and 3 column made of the three numbers extracted each times.
The question is: How could i implement an algorithm that give me a future number prediction?
답변 (1개)
Walter Roberson
2016년 11월 4일
Your steps 1 to 3 can be express in MATLAB without a loop, using
[~, idx] = sort( rand(50, 20), 2);
YourRandomData = idx(:,1:3);
On the matter of future number prediction:
What is to be the input? Is it to be a vector of 2 numbers and using the information learned from the 50 x 3 array it is to predict that the 3rd number is to be in 1 to 20 and not one of the first two numbers? That is, are you trying to create a neural network that will have deduced the rule of construction of the array, that the entries are integers in 1 to 20 and not repeated in any one row?
댓글 수: 4
simone martinelli
2016년 11월 4일
Walter Roberson
2016년 11월 4일
There is no interaction between the rows, so the 51'st entry should not be predictable with accuracy better than chance. Any neutral network that predicts anything better from the training and test data could be only from overtraining.
simone martinelli
2016년 11월 4일
Walter Roberson
2016년 11월 4일
Let's simplify this for learning purposes.
- I have 2 numbers, from 1 to 2.
- I choose 1 of these 20 numbers in the way that these number are not equal so i choose in a random way 1 not repeated numbers in this interval (A sort of extraction).
- I save these one numbers in a vector.
- I repeat the three previous point so after 50 times i have my origin number from 1 to 2 and a vector made of 50 rows and 1 column made of the one numbers extracted each times.
number_of_states = 2;
number_at_a_time = 1;
[~, idx] = sort( rand(50, number_of_states), 2);
YourRandomData = idx(:,number_at_at_time);
Now just for fun,
state_names = 'HT' .';
named_states = state_names(YourRandomData, 1)
named_states =
H
T
T
T
H
H
H
H
H
H
T
[etc]
If i use the first column of 50 rows to predict the 51th value...
... then I would be predicting the 51'st flip of a coin based upon the first 50 flips of the coin.
If the coin flip is "fair" (uniformly distributed), then any correlation found would be accidental.
You can make predictions on such a system, but what you would e testing would be the "fairness" of the random assignment that created the data.
카테고리
도움말 센터 및 File Exchange에서 Function Approximation and Clustering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!