Examples of SparseVector


Examples of org.grouplens.lenskit.vectors.SparseVector

    @Test
    public void testSingleValue() {
        acc.put(5, Math.PI);
        assertThat(acc.globalMean(),
                   closeTo(Math.PI, EPSILON));
        SparseVector v = acc.idMeans();
        assertThat(v.size(), equalTo(1));
        assertThat(v.get(5), closeTo(Math.PI, EPSILON));
    }
View Full Code Here

Examples of types.SparseVector

        SparseVector[] x = new SparseVector[words.size()];
        Object[] y = new Object[tags.size()];
        for (int t = 0; t < x.length; t++) {
          y[t] = tags.get(t);
          String word = "^" + words.get(t) + "$";
          x[t] = new SparseVector();
          x[t].add(xAlphabet.lookupObject(word), 1);
          for (int i = 0; i < word.length() - 3; i++) {
            x[t].add(xAlphabet.lookupObject(word
                .substring(i, i + 3)), 1);
          }
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.