Example usage for org.apache.mahout.math SequentialAccessSparseVector set

List of usage examples for org.apache.mahout.math SequentialAccessSparseVector set

Introduction

In this page you can find the example usage for org.apache.mahout.math SequentialAccessSparseVector set.

Prototype

@Override
    public void set(int index, double value) 

Source Link

Usage

From source file:com.innometrics.integration.app.recommender.ml.als.ALSWRFactorizer.java

License:Apache License

protected Vector sparseItemRatingVector(PreferenceArray prefs) {
    SequentialAccessSparseVector ratings = new SequentialAccessSparseVector(Integer.MAX_VALUE, prefs.length());
    for (Preference preference : prefs) {
        ratings.set(userIndex(preference.getUserID()), preference.getValue());
    }//from ww  w  .j a  v a 2 s .c o m
    return ratings;
}

From source file:com.innometrics.integration.app.recommender.ml.als.ALSWRFactorizer.java

License:Apache License

protected Vector sparseUserRatingVector(PreferenceArray prefs) {
    SequentialAccessSparseVector ratings = new SequentialAccessSparseVector(Integer.MAX_VALUE, prefs.length());
    for (Preference preference : prefs) {
        ratings.set(itemIndex(preference.getItemID()), preference.getValue());
    }/*  www  .  j a  v  a2s  . c  om*/
    return ratings;
}

From source file:org.codelibs.elasticsearch.taste.recommender.svd.ALSWRFactorizer.java

License:Apache License

protected Vector sparseItemRatingVector(final PreferenceArray prefs) {
    final SequentialAccessSparseVector ratings = new SequentialAccessSparseVector(Integer.MAX_VALUE,
            prefs.length());/*from  w ww . jav  a2s.  c  o  m*/
    for (final Preference preference : prefs) {
        ratings.set((int) preference.getUserID(), preference.getValue());
    }
    return ratings;
}

From source file:org.codelibs.elasticsearch.taste.recommender.svd.ALSWRFactorizer.java

License:Apache License

protected Vector sparseUserRatingVector(final PreferenceArray prefs) {
    final SequentialAccessSparseVector ratings = new SequentialAccessSparseVector(Integer.MAX_VALUE,
            prefs.length());/*w  w w .  ja v  a 2  s  . c om*/
    for (final Preference preference : prefs) {
        ratings.set((int) preference.getItemID(), preference.getValue());
    }
    return ratings;
}

From source file:org.plista.kornakapi.core.optimizer.ErrorALSWRFactorizer.java

License:Apache License

protected Vector sparseItemRatingVector(PreferenceArray prefs) {
    SequentialAccessSparseVector ratings = new SequentialAccessSparseVector(Integer.MAX_VALUE, prefs.length());
    for (Preference preference : prefs) {
        ratings.set((int) preference.getUserID(), preference.getValue());
    }/* w  w w  .  j a v  a 2  s.  com*/
    return ratings;
}

From source file:org.plista.kornakapi.core.optimizer.ErrorALSWRFactorizer.java

License:Apache License

protected Vector sparseUserRatingVector(PreferenceArray prefs) {
    SequentialAccessSparseVector ratings = new SequentialAccessSparseVector(Integer.MAX_VALUE, prefs.length());
    for (Preference preference : prefs) {
        ratings.set((int) preference.getItemID(), preference.getValue());
    }//from   www.jav  a 2 s.  co m
    return ratings;
}