int[] idx = new int[label.Length];
Parallel.For( 0 , label.Length , i => {
idx[i] = i;
} );
Random rnd = new Random();
int trainNum = (int)(label.Length *trainSize);
int[] rndIdx = idx.OrderBy(x => rnd.Next()).ToArray
int[] trainIdx = idx.Take(trainNum).ToArray();
int[] testIdx = idx.Skip(trainNum).ToArray();
}
댓글 없음:
댓글 쓰기