如何跟踪hadoop als的进度?

ltskdhd1  于 2021-05-31  发布在  Hadoop
关注(0)|答案(0)|浏览(268)

我用这段代码来计算建议:

SparkSession spark = SparkSession
            .builder()
            .appName("SomeAppName")
            .config("spark.master", "local")
            .getOrCreate();
    JavaRDD<Rating> ratingsRDD = spark
            .read().textFile(args[0]).javaRDD()
            .map(Rating::parseRating);
    Dataset<Row> ratings = spark.createDataFrame(ratingsRDD, Rating.class);
    ALS als = new ALS()
            .setMaxIter(1)
            .setRegParam(0.01)
            .setUserCol("userId")
            .setItemCol("movieId")
            .setRatingCol("rating");
    ALSModel model = als.fit(ratings);
    model.setColdStartStrategy("drop");
    Dataset<Row> rowDataset = model.recommendForAllUsers(50);

我想跟踪迭代的进度,理想的情况是查看迭代次数,我可以为此提供java回调吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题