boolean sparse = featureSubArray[0].isSparse();
DoubleMatrix outcomeMat = null;
if (outcomeMatrix != null) {
DoubleVector[] outcomeSubArray = ArrayUtils.subArray(outcomeMatrix,
start, end);
outcomeMat = new DenseDoubleMatrix(outcomeSubArray);
}
DenseDoubleVector bias = DenseDoubleVector.ones(featureSubArray.length);
DoubleMatrix featureMatrix = sparse ? new SparseDoubleRowMatrix(
featureSubArray) : new DenseDoubleMatrix(featureSubArray);
DoubleMatrix featuresWithBias = sparse ? new SparseDoubleRowMatrix(bias,
featureMatrix) : new DenseDoubleMatrix(bias, featureMatrix);
batches.add(new Tuple<>(featuresWithBias, outcomeMat));
}
}