The ALSTrain class defines a wrapper function that uses the Aster Spark API to generate an Alternating Least Square (ALS) model from sample data. The model is typically used by the ALSRun 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
Model, saved in the Spark-side file system, which can be used later for prediction.
Invocation Example
SELECT * FROM RunOnSpark ( ON ratings SPARKCODE ('com.teradata.aster.functions.ALSTrain /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.