Package org.grouplens.lenskit.eval.traintest

Examples of org.grouplens.lenskit.eval.traintest.SimpleEvaluator


    @Test
    public void testAlgorithmAccuracy() throws TaskExecutionException, IOException {
        Properties props =  new Properties();
        props.setProperty(EvalConfig.DATA_DIR_PROPERTY, workDir.newFolder("data").getAbsolutePath());
        SimpleEvaluator evalCommand = new SimpleEvaluator(props);
        AlgorithmInstanceBuilder algo = new AlgorithmInstanceBuilder();
        configureAlgorithm(algo.getConfig());
        evalCommand.addAlgorithm(algo);

        evalCommand.addDataset(new GenericDataSource("ml-100k", dao, PreferenceDomain.fromString("[1,5]/1")), 5, 0.2);

        evalCommand.addMetric(new CoveragePredictMetric())
                   .addMetric(new RMSEPredictMetric())
                   .addMetric(new MAEPredictMetric());


        Table result = evalCommand.call();
        assertThat(result, notNullValue());
        checkResults(result);
    }
View Full Code Here

TOP

Related Classes of org.grouplens.lenskit.eval.traintest.SimpleEvaluator

Copyright © 2018 www.massapicom. 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.