How to reverse data normalized with bsx function
2 views (last 30 days)
Show older comments
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
Greg Heath
on 24 May 2013
Edited: Greg Heath
on 24 May 2013
What is RVM?
size(yTest) = ?
help zscore
doc zscore
Accepted Answer
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
More Answers (0)
See Also
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!