CO algo with training and subsampling