PredictionIO / template-scala-parallel-universal-recommendation

PredictiionIO Template for Universal Recommender
111 stars 48 forks source link

Preserve data on non-active items for PopModel #31

Open chEbba opened 8 years ago

chEbba commented 8 years ago

Model:

Training: https://github.com/PredictionIO/template-scala-parallel-universal-recommendation/blob/v0.2.3/src/main/scala/URAlgorithm.scala#L152-L168

      val pm = if (pms._1.nonEmpty && pms._2.nonEmpty) {
          val newPM = pms._1.head.fields + (backfillFieldName -> JDouble(pms._2.head))
          PropertyMap(newPM, pms._1.head.firstUpdated, DateTime.now())
        } else if (pms._2.nonEmpty) PropertyMap(Map(backfillFieldName -> JDouble(pms._2.head)), DateTime.now(), DateTime.now())
        else PropertyMap( Map.empty[String, JValue], DateTime.now, DateTime.now) // some error????

Query:

Solution: