How to reverse data normalized with bsx function

2 views (last 30 days)
I used the code below to normalise the targets to perform RVM regression.
mn1 = mean(yTest);
sd1 = std(yTest);
sd1(sd1==0) = 1;
ynV = bsxfun(@minus,yTest,mn1);
ynV = bsxfun(@rdivide,ynV,sd1);
Can you please help to extract the predicted targets ..Thank you..
  2 Comments
Iain
Iain on 22 May 2013
I don't understand your question...
Greg Heath
Greg Heath on 24 May 2013
Edited: Greg Heath on 24 May 2013
What is RVM?
size(yTest) = ?
help zscore
doc zscore

Sign in to comment.

Accepted Answer

José-Luis
José-Luis on 22 May 2013
Edited: José-Luis on 22 May 2013
your_original_data = bsxfun(@times,ynV,sd1);
your_original_data = bsxfun(@plus,your_original_data,mn1);
What is the purpose of sd1(sd1==0) = 1 ? If that is really what you meant then, you also need to store the indexes of the affected values:
mn1 = mean(yTest);
sd1 = std(yTest);
idx = find(sd1 == 0);
sd1(sd1==0) = 1;
ynV = bsxfun(@minus,yTest,mn1);
ynV = bsxfun(@rdivide,ynV,sd1);
your_original_data = bsxfun(@times,ynV,sd1);
your_original_data(idx) = 0;
your_original_data = bsxfun(@plus,your_original_data,mn1);
  6 Comments
Diana
Diana on 23 May 2013
I now found my error...i was actually comparing the stored values...it should have been the "data" instead of "targets" in code....you are great!!!thanks a lot for your time answering me!!!!Cheers

Sign in to comment.

More Answers (0)

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!