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 is the stable version. Apart from bugfixes, this version
does not receive any other updates.
/*
* 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 .
*/
/*
* AttributeSelection.java
* Copyright (C) 1999-2012 University of Waikato, Hamilton, New Zealand
*
*/
package weka.filters.supervised.attribute;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Vector;
import weka.attributeSelection.ASEvaluation;
import weka.attributeSelection.ASSearch;
import weka.attributeSelection.AttributeEvaluator;
import weka.attributeSelection.AttributeTransformer;
import weka.attributeSelection.BestFirst;
import weka.attributeSelection.CfsSubsetEval;
import weka.attributeSelection.Ranker;
import weka.core.Attribute;
import weka.core.Capabilities;
import weka.core.Capabilities.Capability;
import weka.core.DenseInstance;
import weka.core.Instance;
import weka.core.Instances;
import weka.core.Option;
import weka.core.OptionHandler;
import weka.core.RevisionUtils;
import weka.core.SparseInstance;
import weka.core.Utils;
import weka.filters.Filter;
import weka.filters.SupervisedFilter;
/**
* A supervised attribute filter that can be used to
* select attributes. It is very flexible and allows various search and
* evaluation methods to be combined.
*
*
* Valid options are:
*
*
*
* -S <"Name of search class [search options]">
* Sets search method for subset evaluators.
* eg. -S "weka.attributeSelection.BestFirst -S 8"
*
*
*
* -E <"Name of attribute/subset evaluation class [evaluator options]">
* Sets attribute/subset evaluator.
* eg. -E "weka.attributeSelection.CfsSubsetEval -L"
*
*
*
* Options specific to evaluator weka.attributeSelection.CfsSubsetEval:
*
*
*
* -M
* Treat missing values as a seperate value.
*
*
*
* -L
* Don't include locally predictive attributes.
*
*
*
* Options specific to search weka.attributeSelection.BestFirst:
*
*
*
* -P <start set>
* Specify a starting set of attributes.
* Eg. 1,3,5-7.
*
* -N <num>
* Number of non-improving nodes to
* consider before terminating search.
*
*
*
* -S <num>
* Size of lookup cache for evaluated subsets.
* Expressed as a multiple of the number of
* attributes in the data set. (default = 1)
*
*
*
* @author Mark Hall ([email protected])
* @version $Revision: 10866 $
*/
public class AttributeSelection extends Filter implements SupervisedFilter,
OptionHandler {
/** for serialization */
static final long serialVersionUID = -296211247688169716L;
/** the attribute selection evaluation object */
private weka.attributeSelection.AttributeSelection m_trainSelector;
/** the attribute evaluator to use */
private ASEvaluation m_ASEvaluator;
/** the search method if any */
private ASSearch m_ASSearch;
/** holds the selected attributes */
private int[] m_SelectedAttributes;
/** True if a class attribute is set in the data */
protected boolean m_hasClass;
/**
* Returns a string describing this filter
*
* @return a description of the filter suitable for displaying in the
* explorer/experimenter gui
*/
public String globalInfo() {
return "A supervised attribute filter that can be used to select "
+ "attributes. It is very flexible and allows various search "
+ "and evaluation methods to be combined.";
}
/**
* Constructor
*/
public AttributeSelection() {
resetOptions();
}
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
@Override
public Enumeration