Package org.grouplens.lenskit.util.table

Examples of org.grouplens.lenskit.util.table.TableLayout


    /**
     * Prepare the evaluation by opening all outputs and initializing metrics.
     */
    ExperimentOutputs openExperimentOutputs(ExperimentOutputLayout layouts, MeasurementSuite measures, TableWriter results, Closer closer) throws IOException {
        TableLayout resultLayout = layouts.getResultsLayout();
        TableWriter allResults = results;
        if (outputFile != null) {
            TableWriter disk = closer.register(CSVWriter.open(outputFile, resultLayout));
            allResults = new MultiplexedTableWriter(resultLayout, allResults, disk);
        }
View Full Code Here


    public OutputTopNMetric(ExperimentOutputLayout layout, File file,
                            int listSize, ItemSelector candidates, ItemSelector exclude) throws IOException {
        super(Void.TYPE, Void.TYPE);
        outputLayout = layout;

        TableLayout recLayout = TableLayoutBuilder.copy(layout.getCommonLayout())
                                                  .addColumn("User")
                                                  .addColumn("Item")
                                                  .addColumn("Rank")
                                                  .addColumn("Score")
                                                  .build();
View Full Code Here

     * @param values The initial values to write. Each row written to this table
     *               writer is written to the base writer with these values prefixed.
     */
    public PrefixedTableWriter(TableWriter writer, List<?> values) {
        baseWriter = writer;
        TableLayout baseLayout = writer.getLayout();
        if (values.size() > baseLayout.getColumnCount()) {
            throw new IllegalArgumentException("Value array too wide");
        }

        rowData = new ObjectArrayList<Object>(writer.getLayout().getColumnCount());
        rowData.addAll(values);

        fixedColumns = values.size();

        TableLayoutBuilder bld = new TableLayoutBuilder();
        List<String> bheaders = baseLayout.getColumns();
        for (String h : bheaders.subList(fixedColumns, bheaders.size())) {
            bld.addColumn(h);
        }
        layout = bld.build();
        assert layout.getColumnCount() + rowData.size() == writer.getLayout().getColumnCount();
View Full Code Here

        for (String attr: experiments.getAlgorithmAttributes()) {
            algoColumns.put(attr, master.getColumnCount());
            master.addColumn(attr);
        }

        TableLayout common = master.build();

        TableLayout results = layoutAggregateOutput(master, measurements);
        TableLayout user = layoutUserTable(master, measurements);

        return new ExperimentOutputLayout(common, dataColumns, algoColumns, results, user);
    }
View Full Code Here

TOP

Related Classes of org.grouplens.lenskit.util.table.TableLayout

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.