The ALSTrain class defines a wrapper function that uses the Aster Spark API to make predictions based on an ALS model Alternating Least Square (ALS) model. The model is typically generated by the ALSTrain function.
Run Method Signature
run (input: RDD(DataRow), SparkFunctParams: String): RDD(DataRow)
Input
Three columns:
- user identifier (INTEGER)
- product identifier (INTEGER)
- rating (DOUBLE PRECISION in range [1.0, 5.0])
Output
Three columns:
- user identifier (INTEGER)
- product identifier (INTEGER)
- rating (DOUBLE PRECISION in range [1.0, 5.0])
Invocation Example
SELECT * FROM RunOnSpark ( ON ratings SPARKCODE ('com.teradata.aster.functions.ALSRun /tmp/ALSModel1 true 10 2.0 20 2 2 false') OUTPUTS ('user_id integer', 'product_id integer', 'rating double precision') ) ORDER BY user_id;
Version
Spark 1.3 and later.