且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Matlab中对特定行进行采样

更新时间:2023-01-20 17:13:49

您可以从以下代码示例开始,它选择标签向量的随机样本,并查找至少已选择一次标签向量的值:

you could start with this little sample of code, it selects random samples of your label vector and find which values of your label vector have been selected at least once:

Label = [1; 3; 5; ....... 6];
index = randi(N,m1,1);
index = unique(index);
LabelIndicatorMatrix = zeros(N,1);
LabelIndicatorMatrix(index)=1;

那表示我不确定我是否了解LabelIndicatorMatrix的最终条件.

That said I am not sure I understand the final condition on the LabelIndicatorMatrix.