code for prediction in artificial neural network and extreme learning machine is same?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i have this code of prediction i want to know it can be used for prediction of any thing like disease, weather etc. please help
function scores = elmPredict( X, inW, bias, outW ) % FUNCTION predicts the labels of some testing data using a trained Extreme % Learning Machine. % % scores = elmPredict( X, inW, bias, outW ); % % INPUT : % X - data patterns (column vectors) % inW - input weights vector (trained model) % bias - bias vector (trained model) % outW - output weights vector (trained model) % % OUTPUT : % scores - prediction scores on the data %
% number of test patterns nTestData = size( X, 2 );
% compute the pre-H matrix preH = inW * X;
% build the bias matrix biasM = repmat( bias, 1, nTestData );
% update the pre-H matrix preH = preH + biasM;
% apply the activation function H = 1 ./ (1 + exp(-preH));
% compute prediction scores scores = (H' * outW)';
1 Commento
Greg Heath
il 3 Apr 2017
Please format so the code will run if cut and pasted in the command line
Greg
Risposta accettata
John D'Errico
il 3 Apr 2017
Modificato: John D'Errico
il 3 Apr 2017
Are you asking if the same model can be used to predict anything, from the weather in Timbuktu, to the price of pork belly futures, the population of wolves in the arctic, propagation of disease in a flu epidemic, the modes of vibration of a string in a concert violin, or the shape of a spinning platter in your hard disk drive?
Surely you must appreciate that every problem is different. Some problems are more complex than others, so they require a more sophisticated model. Others are so simple that a simple average is sufficient.
There is no god model, a model that will predict anything, and do that job well. In fact, even if there were some sufficiently complex model that could handle all problems, it would be wild overkill on many problems. Thus a highly complex model, when applied to a very simple system will tend to overfit the data. The result will be the model tries to predict the random noise in a system. Since this is unpredictable, you get garbage, the classic result of overfitting. In a system where the noise is more significant than the actual signal, that predicted noise will overwhelm any useful predictive ability.
So no, no single model is correct for all problems. In fact, some models are far more appropriate for the system they are derived to predict. If you have a model that is based on physical principles that match your system, then it will often be far better than using some generic model.
Edit: Lets look at some specific problems.
Consider the data
x = rand(25,1);
y = rand(25,1);
plot(x,y,'o')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/173689/image.jpeg)
You and I know the data is totally random. The best model for this system is:
y(x) = 0.5
or, if we will estimate it from the data,
y(x) = mean(y)
But if we look long and closely at that plot, our brains can see patterns. They will see patterns in randomness. And what are neural nets based on? A model of neurons.
So suppose we generate a sequence of flips of a pair of coins, a penny, and a silver dollar. Suppose I made a wager with you, that if you can predict the flip of the silver dollar, using the information gained by flipping a penny, then I will give you a silver dollar every time you are correct. You must give me $1.25 when you are wrong though.
HT = 'HT';
penny = HT(round(rand(1,10)) + 1)
penny =
TTHHHHTHHT
dollar = HT(round(rand(1,10)) + 1)
dollar =
TTTHTHTTHT
On these short sequence above, it looks like the penny is doing a great job of prediction. You should make money here. Again though, we know the system is random. The "coin" tosses were independent random variables. But the mind is great at seeing these patterns. Effectively, our own private neural nets are great at overfitting models to data, seeing structure when none exists.
Again, the trick is to understand your system to be modeled. Is there an appropriate model for the physical system? Is there a good metaphorical model? For example, disease propagation models can be great models for the sales of a product. People tell their friends about a product they just bought, so transmitting the "disease" to their contacts. Of course, some people are more resistant to such propagation, they have varying levels of "immunity" to this "disease".
There is no god model, nor should there really be one. Neural nets are not always the correct choice, even though they are sometimes a great choice.
0 Commenti
Più risposte (1)
Heba Osman
il 17 Feb 2018
could you show the implementation of the elmPredict function please ? i already used the extreme learning machine function with my data but i can't predict future values !
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!