@Override OpenIntObjectHashMap<Vector> createSharedInstance(Context ctx) throws IOException { Configuration conf = ctx.getConfiguration(); int numEntities = Integer.parseInt(conf.get(ParallelALSFactorizationJob.NUM_ENTITIES)); return ALS.readMatrixByRowsFromDistributedCache(numEntities, conf); }
@Override OpenIntObjectHashMap<Vector> createSharedInstance(Context ctx) throws IOException { Configuration conf = ctx.getConfiguration(); int numEntities = Integer.parseInt(conf.get(ParallelALSFactorizationJob.NUM_ENTITIES)); return ALS.readMatrixByRowsFromDistributedCache(numEntities, conf); }
@Override OpenIntObjectHashMap<Vector> createSharedInstance(Context ctx) throws IOException { Configuration conf = ctx.getConfiguration(); int numEntities = Integer.parseInt(conf.get(ParallelALSFactorizationJob.NUM_ENTITIES)); return ALS.readMatrixByRowsFromDistributedCache(numEntities, conf); }
@Override ImplicitFeedbackAlternatingLeastSquaresSolver createSharedInstance(Context ctx) throws IOException { Configuration conf = ctx.getConfiguration(); double lambda = Double.parseDouble(conf.get(ParallelALSFactorizationJob.LAMBDA)); double alpha = Double.parseDouble(conf.get(ParallelALSFactorizationJob.ALPHA)); int numFeatures = conf.getInt(ParallelALSFactorizationJob.NUM_FEATURES, -1); int numEntities = Integer.parseInt(conf.get(ParallelALSFactorizationJob.NUM_ENTITIES)); Preconditions.checkArgument(numFeatures > 0, "numFeatures must be greater then 0!"); return new ImplicitFeedbackAlternatingLeastSquaresSolver(numFeatures, lambda, alpha, ALS.readMatrixByRowsFromDistributedCache(numEntities, conf)); }
@Override ImplicitFeedbackAlternatingLeastSquaresSolver createSharedInstance(Context ctx) throws IOException { Configuration conf = ctx.getConfiguration(); double lambda = Double.parseDouble(conf.get(ParallelALSFactorizationJob.LAMBDA)); double alpha = Double.parseDouble(conf.get(ParallelALSFactorizationJob.ALPHA)); int numFeatures = conf.getInt(ParallelALSFactorizationJob.NUM_FEATURES, -1); int numEntities = Integer.parseInt(conf.get(ParallelALSFactorizationJob.NUM_ENTITIES)); Preconditions.checkArgument(numFeatures > 0, "numFeatures must be greater then 0!"); return new ImplicitFeedbackAlternatingLeastSquaresSolver(numFeatures, lambda, alpha, ALS.readMatrixByRowsFromDistributedCache(numEntities, conf), 1); }
@Override ImplicitFeedbackAlternatingLeastSquaresSolver createSharedInstance(Context ctx) throws IOException { Configuration conf = ctx.getConfiguration(); double lambda = Double.parseDouble(conf.get(ParallelALSFactorizationJob.LAMBDA)); double alpha = Double.parseDouble(conf.get(ParallelALSFactorizationJob.ALPHA)); int numFeatures = conf.getInt(ParallelALSFactorizationJob.NUM_FEATURES, -1); int numEntities = Integer.parseInt(conf.get(ParallelALSFactorizationJob.NUM_ENTITIES)); Preconditions.checkArgument(numFeatures > 0, "numFeatures must be greater then 0!"); return new ImplicitFeedbackAlternatingLeastSquaresSolver(numFeatures, lambda, alpha, ALS.readMatrixByRowsFromDistributedCache(numEntities, conf), 1); }