Package org.apache.mahout.cf.taste.similarity

Examples of org.apache.mahout.cf.taste.similarity.ItemSimilarity.refresh()


    /* change the underlying file,
     * we have to wait at least a second to see the change in the file's lastModified timestamp */
    Thread.sleep(2000L);
    writeLines(testFile, changedData);

    similarity.refresh(null);

    /* we should now see the changes in the data */
    assertEquals(0.9, similarity.itemSimilarity(1L, 7L), EPSILON);
    assertEquals(0.9, similarity.itemSimilarity(7L, 1L), EPSILON);
    assertEquals(0.125, similarity.itemSimilarity(1L, 5L), EPSILON);
View Full Code Here


    /* change the underlying file,
     * we have to wait at least a second to see the change in the file's lastModified timestamp */
    Thread.sleep(2000L);
    writeLines(testFile, changedData);

    similarity.refresh(null);

    /* we should now see the changes in the data */
    assertEquals(0.9, similarity.itemSimilarity(1L, 7L), EPSILON);
    assertEquals(0.9, similarity.itemSimilarity(7L, 1L), EPSILON);
    assertEquals(0.125, similarity.itemSimilarity(1L, 5L), EPSILON);
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.