Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
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.
/*
* 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 .
*/
/*
* RandomSubset.java
* Copyright (C) 2007-2012 University of Waikato, Hamilton, New Zealand
*/
package weka.filters.unsupervised.attribute;
import java.util.*;
import weka.core.*;
import weka.core.Capabilities.Capability;
import weka.filters.SimpleBatchFilter;
/**
* Chooses a random subset of non-class attributes, either an absolute number or a percentage. Attributes are included
* in the order in which they occur in the input data. The class attribute (if present) is always included in the output.
*
*
* Valid options are:
*
*
-N <double>
* The number of attributes to randomly select.
* If < 1 then percentage, >= 1 absolute number.
* (default: 0.5)
*
*
-V
* Invert selection - i.e. randomly remove rather than select.
*
*
-S <int>
* The seed value.
* (default: 1)
*
*
-output-debug-info
* If set, filter is run in debug mode and
* may output additional info to the console
*
*
-do-not-check-capabilities
* If set, filter capabilities are not checked before filter is built
* (use with caution).
*
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @author [email protected]
* @version $Revision: 15073 $
*/
public class RandomSubset extends SimpleBatchFilter
implements Randomizable, WeightedInstancesHandler, WeightedAttributesHandler {
/** for serialization. */
private static final long serialVersionUID = 2911221724251628050L;
/**
* The number of attributes to randomly choose (>= 1 absolute number of
* attributes, < 1 percentage).
*/
protected double m_NumAttributes = 0.5;
/** The seed value. */
protected int m_Seed = 1;
/** The indices of the attributes that got selected. */
protected int[] m_Indices = null;
/** Whether to randomly remove rather than select */
protected boolean m_invertSelection;
/**
* 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 "Chooses a random subset of non-class attributes, either an absolute number "
+ "or a percentage. Attributes are included in the order in which they occur in the input data. The class "
+ "attribute (if present) is always included in the output.";
}
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
@Override
public Enumeration