How to find 'within group correlation'?
3 次查看(过去 30 天)
显示 更早的评论
I am new to matlab and I'm working on a problem with training data X and target data t. The target t is either 1 or 0 denoting which class the rows of X belong to. X is a 179x2 matrix, and I'm supposed to find the "within group correlation" between two variables x1 and x2 for each class. Can anyone explain how to do this? The professor's notes don't mention this at all
0 个评论
回答(1 个)
Jeff Miller
2020-7-27
I would guess the idea is this:
grp0 = t == 0;
grp1 = t == 1;
corr(x(grp0,:))
corr(x(grp1,:))
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!