Plotting higher-dimensional data in two-dimensions which has already processed using supervised learning
4 次查看(过去 30 天)
显示 更早的评论
Hello,
So here is the challenge I am currently facing:
I have 100 points of five-dimensional data with 100 associated outcome measures (which are binary). I was able to determine well-fitting logistic regression coefficients where the logit transform exp(g(x))/(exp(g(x))+1) contains the generalized linear model g(x) = ax1+bx2+cx3+dx4+ex5+constant. The regression model was scaled to yield an output (risk) between 0 and 1.
With all of this in mind, I am looking for a way to plot the results on a 2D plot, perhaps using the output from the regression model (risk) as a color-code.
What I have tried so far: 1. Using PCA biplot vector to denote rate of increase (slope) of regression output (risk) based on each particular variable. This was a perfect idea except MATLAB's contouring requires a full-matrix of data and all I have are two PCA components with associated regression output (three vectors). 2. MDS for colorwashing but I would like to somehow include the magnitude of the contribution of each variable in the plot (something which, to my knowledge, MDS does not provide)
Thanks
0 个评论
采纳的回答
Christopher Berry
2014-8-11
编辑:Christopher Berry
2014-8-11
James,
I think what you might be looking for is scatter coupled with specifying the MarkerColor as a vector corresponding to your linear regression output, g.
Let me show you what I mean using the example data from the biplot documentation (its also 5-dimensional data):
load carsmall
x = [Acceleration Displacement Horsepower MPG Weight];
x = x(all(~isnan(x),2),:);
[coefs,score] = pca(zscore(x));
Now, instead of using biplot, use scatter. The vector g would be the output of your regression model, but here I will just use a dummy vector the same length as my data.
s = 40; %Size of markers, can be a vector or a constant
g = linspace(1,10,length(coefs(:,1))); %Just a dummy g
scatter(coefs(:,1),coefs(:,2),s,g,'fill')
colorbar
You can also do something similar using the MarkerSize vector s, or scale both size and color simultaneously.
Also, this example is for plotting just the first 2 principal components, but if you want to visualize the first 3 principal components, you can use scatter3 and the same workflow described above.
0 个评论
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!