Package org.apache.mahout.math.als

Examples of org.apache.mahout.math.als.AlternatingLeastSquaresSolver.solve()


              List<Vector> featureVectors = Lists.newArrayList();
              while (itemIDsFromUser.hasNext()) {
                long itemID = itemIDsFromUser.nextLong();
                featureVectors.add(features.getItemFeatureColumn(itemIndex(itemID)));
              }
              Vector userFeatures = solver.solve(featureVectors, ratingVector(userPrefs), lambda, numFeatures);
              features.setFeatureColumnInU(userIndex(userID), userFeatures);
            }
          });
        }
      } finally {
View Full Code Here


              List<Vector> featureVectors = Lists.newArrayList();
              for (Preference pref : itemPrefs) {
                long userID = pref.getUserID();
                featureVectors.add(features.getUserFeatureColumn(userIndex(userID)));
              }
              Vector itemFeatures = solver.solve(featureVectors, ratingVector(itemPrefs), lambda, numFeatures);
              features.setFeatureColumnInM(itemIndex(itemID), itemFeatures);
            }
          });
        }
      } finally {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.