ALSRun - Aster Analytics

Teradata AsterĀ® Spark Connector User Guide

Product
Aster Analytics
Release Number
7.00.00.01
Published
May 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
dbt1482959363906.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
dbt1482959363906
lifecycle
previous
Product Category
Software

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.