如何在java中将字符串id转换为整数
JavaRDD<Rating> ratings = feedbackRDD.map((Function<Document, Rating>) d -> new Rating(d.getInteger("user"), d.getInteger("product"), ((Number) d.get("rating")).doubleValue()));
MatrixFactorizationModel model = ALS.train(JavaRDD.toRDD(ratings), 5, 10, 0.01);
要使用spark.mllib.recommendation库spark.mllib.recommendation.rating,要求两个值都是整数。在java中如何将字符串ID转换为整数?
暂无答案!
目前还没有任何答案,快来回答吧!