All Downloads are FREE. Search and download functionalities are using the official Maven repository.

weka.filters.unsupervised.attribute.PartitionedMultiFilter Maven / Gradle / Ivy

Go to download

The Waikato Environment for Knowledge Analysis (WEKA), a machine learning workbench. This version represents the developer version, the "bleeding edge" of development, you could say. New functionality gets added to this version.

There is a newer version: 3.9.6
Show newest version
/*
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see .
 */

/*
 * PartitionedMultiFilter.java
 * Copyright (C) 2006-2016 University of Waikato, Hamilton, New Zealand
 *
 */

package weka.filters.unsupervised.attribute;

import weka.core.*;
import weka.filters.AllFilter;
import weka.filters.Filter;
import weka.filters.SimpleBatchFilter;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Vector;

/**
 *  A filter that applies filters on subsets of
 * attributes and assembles the output into a new dataset. Attributes that are
 * not covered by any of the ranges can be either retained or removed from the
 * output.
 * 

* * * Valid options are: *

* *

 * -D
 *  Turns on output of debugging information.
 * 
* *
 * -F <classname [options]>
 *  A filter to apply (can be specified multiple times).
 * 
* *
 * -R <range>
 *  An attribute range (can be specified multiple times).
 *  For each filter a range must be supplied. 'first' and 'last'
 *  are valid indices. 'inv(...)' around the range denotes an
 *  inverted range.
 * 
* *
 * -U
 *  Flag for leaving unused attributes out of the output, by default
 *  these are included in the filter output.
 * 
* * * * @author FracPete (fracpete at waikato dot ac dot nz) * @version $Revision: 14508 $ * @see weka.filters.StreamableFilter */ public class PartitionedMultiFilter extends SimpleBatchFilter implements WeightedInstancesHandler, WeightedAttributesHandler { /** for serialization. */ private static final long serialVersionUID = -6293720886005713120L; /** The filters. */ protected Filter m_Filters[] = { new AllFilter() }; /** The attribute ranges. */ protected Range m_Ranges[] = { new Range("first-last") }; /** Whether unused attributes are left out of the output. */ protected boolean m_RemoveUnused = false; /** the indices of the unused attributes. */ protected int[] m_IndicesUnused = new int[0]; /** * Returns a string describing this filter. * * @return a description of the filter suitable for displaying in the * explorer/experimenter gui */ @Override public String globalInfo() { return "A filter that applies filters on subsets of attributes and " + "assembles the output into a new dataset. Attributes that are " + "not covered by any of the ranges can be either retained or removed " + "from the output."; } /** * Returns an enumeration describing the available options. * * @return an enumeration of all the available options. */ @Override public Enumeration