|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.apache.spark.mllib.recommendation.ALS
public class ALS
Constructor Summary | |
---|---|
ALS()
|
Method Summary | |
---|---|
MatrixFactorizationModel |
run(JavaRDD<Rating> ratings)
|
MatrixFactorizationModel |
run(RDD<Rating> ratings)
|
ALS |
setAlpha(double alpha)
|
ALS |
setBlocks(int numBlocks)
|
ALS |
setCheckpointInterval(int checkpointInterval)
|
ALS |
setFinalRDDStorageLevel(StorageLevel storageLevel)
|
ALS |
setImplicitPrefs(boolean implicitPrefs)
|
ALS |
setIntermediateRDDStorageLevel(StorageLevel storageLevel)
|
ALS |
setIterations(int iterations)
|
ALS |
setLambda(double lambda)
|
ALS |
setNonnegative(boolean b)
|
ALS |
setProductBlocks(int numProductBlocks)
|
ALS |
setRank(int rank)
|
ALS |
setSeed(long seed)
|
ALS |
setUserBlocks(int numUserBlocks)
|
static MatrixFactorizationModel |
train(RDD<Rating> ratings,
int rank,
int iterations)
Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs. |
static MatrixFactorizationModel |
train(RDD<Rating> ratings,
int rank,
int iterations,
double lambda)
Train a matrix factorization model given an RDD of ratings given by users to some products, in the form of (userID, productID, rating) pairs. |
static MatrixFactorizationModel |
train(RDD<Rating> ratings,
int rank,
int iterations,
double lambda,
int blocks)
|
static MatrixFactorizationModel |
train(RDD<Rating> ratings,
int rank,
int iterations,
double lambda,
int blocks,
long seed)
|
static MatrixFactorizationModel |
trainImplicit(RDD<Rating> ratings,
int rank,
int iterations)
Train a matrix factorization model given an RDD of 'implicit preferences' ratings given by users to some products, in the form of (userID, productID, rating) pairs. |
static MatrixFactorizationModel |
trainImplicit(RDD<Rating> ratings,
int rank,
int iterations,
double lambda,
double alpha)
Train a matrix factorization model given an RDD of 'implicit preferences' given by users to some products, in the form of (userID, productID, preference) pairs. |
static MatrixFactorizationModel |
trainImplicit(RDD<Rating> ratings,
int rank,
int iterations,
double lambda,
int blocks,
double alpha)
Train a matrix factorization model given an RDD of 'implicit preferences' given by users to some products, in the form of (userID, productID, preference) pairs. |
static MatrixFactorizationModel |
trainImplicit(RDD<Rating> ratings,
int rank,
int iterations,
double lambda,
int blocks,
double alpha,
long seed)
Train a matrix factorization model given an RDD of 'implicit preferences' given by users to some products, in the form of (userID, productID, preference) pairs. |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.spark.Logging |
---|
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning |
Constructor Detail |
---|
public ALS()
Method Detail |
---|
public static MatrixFactorizationModel train(RDD<Rating> ratings, int rank, int iterations, double lambda, int blocks, long seed)
public static MatrixFactorizationModel train(RDD<Rating> ratings, int rank, int iterations, double lambda, int blocks)
public static MatrixFactorizationModel train(RDD<Rating> ratings, int rank, int iterations, double lambda)
ratings
.
ratings
- RDD of (userID, productID, rating) pairsrank
- number of features to useiterations
- number of iterations of ALS (recommended: 10-20)lambda
- regularization factor (recommended: 0.01)
public static MatrixFactorizationModel train(RDD<Rating> ratings, int rank, int iterations)
ratings
.
ratings
- RDD of (userID, productID, rating) pairsrank
- number of features to useiterations
- number of iterations of ALS (recommended: 10-20)
public static MatrixFactorizationModel trainImplicit(RDD<Rating> ratings, int rank, int iterations, double lambda, int blocks, double alpha, long seed)
blocks
.
ratings
- RDD of (userID, productID, rating) pairsrank
- number of features to useiterations
- number of iterations of ALS (recommended: 10-20)lambda
- regularization factor (recommended: 0.01)blocks
- level of parallelism to split computation intoalpha
- confidence parameterseed
- random seed
public static MatrixFactorizationModel trainImplicit(RDD<Rating> ratings, int rank, int iterations, double lambda, int blocks, double alpha)
blocks
.
ratings
- RDD of (userID, productID, rating) pairsrank
- number of features to useiterations
- number of iterations of ALS (recommended: 10-20)lambda
- regularization factor (recommended: 0.01)blocks
- level of parallelism to split computation intoalpha
- confidence parameter
public static MatrixFactorizationModel trainImplicit(RDD<Rating> ratings, int rank, int iterations, double lambda, double alpha)
ratings
.
ratings
- RDD of (userID, productID, rating) pairsrank
- number of features to useiterations
- number of iterations of ALS (recommended: 10-20)lambda
- regularization factor (recommended: 0.01)alpha
- confidence parameter
public static MatrixFactorizationModel trainImplicit(RDD<Rating> ratings, int rank, int iterations)
ratings
.
Model parameters alpha
and lambda
are set to reasonable default values
ratings
- RDD of (userID, productID, rating) pairsrank
- number of features to useiterations
- number of iterations of ALS (recommended: 10-20)
public ALS setBlocks(int numBlocks)
public ALS setUserBlocks(int numUserBlocks)
public ALS setProductBlocks(int numProductBlocks)
public ALS setRank(int rank)
public ALS setIterations(int iterations)
public ALS setLambda(double lambda)
public ALS setImplicitPrefs(boolean implicitPrefs)
public ALS setAlpha(double alpha)
public ALS setSeed(long seed)
public ALS setNonnegative(boolean b)
public ALS setIntermediateRDDStorageLevel(StorageLevel storageLevel)
public ALS setFinalRDDStorageLevel(StorageLevel storageLevel)
public ALS setCheckpointInterval(int checkpointInterval)
public MatrixFactorizationModel run(RDD<Rating> ratings)
public MatrixFactorizationModel run(JavaRDD<Rating> ratings)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |