Hi,
those parts were examples how I had tried. I tried with your suggestions,
but still no success. Additionally,
there were some problems:
val (userFactorsOpt, itemFactorsOpt) = als.factorsOption
If I had just this, userFactorsOpt And itemFactorsOpt did not have write
method. So I added get there i.e.
val (userFactorsOpt, itemFactorsOpt) = als.factorsOption.get
val factorsTypeInfo = TypeInformation.of(classOf[Factors])
val factorsSerializer = factorsTypeInfo.createSerializer(new
ExecutionConfig())
val outputFormat = new TypeSerializerOutputFormat[Factors]
Here, the factorsSerializer was not used at all, so I guess this was missing
line
outputFormat.setSerializer(factorsSerializer)
userFactorsOpt match {
case Some(userFactors) => userFactors.write(outputFormat, "user_path")
case None =>
}
This doesn't run because of error message
Error:(71, 12) constructor cannot be instantiated to expected type;
found : Some[A]
required:
org.apache.flink.api.scala.DataSet[org.apache.flink.ml.recommendation.ALS.Factors]
case Some(userFactors) => userFactorsOpt.write(outputFormat,
"path_to_my_file")
However, I still tried not to have match case i.e.
userFactorsOpt.write(outputFormat, "path")
but nothing was written anywhere.
--
View this message in context:
http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Flink-ML-1-0-0-Saving-and-Loading-Models-to-Score-a-Single-Feature-Vector-tp5766p6059.html
Sent from the Apache Flink User Mailing List archive. mailing list archive at
Nabble.com.