Example usage for weka.filters Filter makeCopy

List of usage examples for weka.filters Filter makeCopy

Introduction

In this page you can find the example usage for weka.filters Filter makeCopy.

Prototype

public static Filter makeCopy(Filter model) throws Exception 

Source Link

Document

Creates a deep copy of the given filter using serialization.

Usage

From source file:meka.experiment.statisticsexporters.WekaFilter.java

License:Open Source License

/**
 * Filters the statistics using the specified filter.
 *
 * @param stats         the stats to filter
 * @return              the filtered stats
 *///from   w w w  .j  a  va2 s .c  o  m
protected List<EvaluationStatistics> filter(List<EvaluationStatistics> stats) {
    Instances data;
    Instances filtered;
    Filter filter;

    try {
        data = toInstances(stats);
        filter = Filter.makeCopy(m_Filter);
        filter.setInputFormat(data);
        filtered = Filter.useFilter(data, filter);
        stats = fromInstances(filtered);
    } catch (Exception e) {
        handleException("Failed to filter statistics!", e);
    }

    return stats;
}