@Test
public void testRating() throws Exception {

    BatchOperator data = BatchOperator.fromTable(
        MLEnvironmentFactory.getDefault().createBatchTable(rows1, new String[]{"user", "item", "rating"}));
    ALS als = new ALS()
        .setUserCol("user")
        .setItemCol("item")
        .setRateCol("rating")
        .setLambda(0.01)
        .setRank(10)
        .setNumIter(10)
        .setPredictionCol("recommendations");
    ALSModel model = als.fit(data);
    BatchOperator modelData = BatchOperator.fromTable(model.getModelData());
    BatchOperator pred = new AlsPredictBatchOp()
        .setUserCol("user").setItemCol("item").setPredictionCol("predicted_rating").linkFrom(modelData, data);
    checkRatingError(pred);
}