ace
Class DimensionalityReducer

java.lang.Object
  extended by ace.DimensionalityReducer

public class DimensionalityReducer
extends java.lang.Object

Applies dimensionality reduction techniques to a set of Weka instances.


Constructor Summary
DimensionalityReducer()
           
 
Method Summary
static weka.core.Instances[] getDimensionallyReducedInstances(weka.core.Instances instances, java.util.LinkedList<java.lang.String> selectors, java.util.LinkedList<java.lang.String> selector_descriptions, java.util.LinkedList<java.lang.String> features_selected, double[][] preparation_times, java.io.OutputStream out, boolean verbose, int max_attribute)
          Perform a variety of features selection techniques on the given instances in order to produce a variety of sets of instances with different selected features.
static weka.attributeSelection.AttributeSelection[] getFeatureSelectors(weka.core.Instances instances, java.util.LinkedList<java.lang.String> selectors, java.util.LinkedList<java.lang.String> selector_descriptions, double[][] preparation_times, int max_attribute, java.io.OutputStream out)
          Return an array of AttributeSelection objects that can be applied to instances.
static java.lang.String getFormattedSelectedFeatureNames(weka.core.Instances instances, int original_number_features)
          Returns a formatted string describing the features available in the given instances.
static java.lang.String getSelectedFeatureNames(weka.attributeSelection.AttributeSelection feature_selection, int original_number_features, weka.core.Instances instances)
          Returns a string detailing the features that have been selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DimensionalityReducer

public DimensionalityReducer()
Method Detail

getSelectedFeatureNames

public static java.lang.String getSelectedFeatureNames(weka.attributeSelection.AttributeSelection feature_selection,
                                                       int original_number_features,
                                                       weka.core.Instances instances)
                                                throws java.lang.Exception
Returns a string detailing the features that have been selected.

Parameters:
feature_selection - The feature selection to describe.
original_number_features - The number of features before selection.
instances - The instances to extract feature names from. May be null, in which case a pre-generated report will be given.
Returns:
String detailing the features that have been selected.
Throws:
java.lang.Exception - If an error occurs.

getDimensionallyReducedInstances

public static weka.core.Instances[] getDimensionallyReducedInstances(weka.core.Instances instances,
                                                                     java.util.LinkedList<java.lang.String> selectors,
                                                                     java.util.LinkedList<java.lang.String> selector_descriptions,
                                                                     java.util.LinkedList<java.lang.String> features_selected,
                                                                     double[][] preparation_times,
                                                                     java.io.OutputStream out,
                                                                     boolean verbose,
                                                                     int max_attribute)
                                                              throws java.lang.Exception
Perform a variety of features selection techniques on the given instances in order to produce a variety of sets of instances with different selected features. These features selection techniques consist of the full set of features available in the given instances as well as each of the techniques specified in the getFeatureSelectors method.

Parameters:
instances - Instances that may be used to train some feature selectors and serve as the basis for the returned sets of instances.
selectors - List that contains the codes for the different dimensionality reduction that will be performed. In this case (experimentation) all possible codes will be present.
selector_descriptions - This list will be filled with descriptions of the returned feature selectors. Warning: any pre-existing contents will be erased.
features_selected - This list will be filled with descriptions of the features selected by each feature selector. Warning: any pre-existing contents will be erased.
preparation_times - The array to be filled with times in seconds needed to prepare each feature selector. The first dimension should have size 1 and the second dimension should be empty.
out - OutputStream to which status updates will be written.
verbose - Whether or not to store detailed information about the dimensionality reduction that was performed.
max_attribute - If the number of attributes for a data set is larger than this number, an exhaustive search will be not be performed.
Returns:
Sets of instances based on the provided instances but after each of the feature selection techniques has been applied. The last index in the array will contain the original instances with no dimensionality reduction applied to them.
Throws:
java.lang.Exception - Throws an exception if a problem occurs.

getFormattedSelectedFeatureNames

public static java.lang.String getFormattedSelectedFeatureNames(weka.core.Instances instances,
                                                                int original_number_features)
Returns a formatted string describing the features available in the given instances.

Parameters:
instances - The instances to get feature names from.
original_number_features - Number of features previously in instances
Returns:
Description of the features available in the given instances.

getFeatureSelectors

public static weka.attributeSelection.AttributeSelection[] getFeatureSelectors(weka.core.Instances instances,
                                                                               java.util.LinkedList<java.lang.String> selectors,
                                                                               java.util.LinkedList<java.lang.String> selector_descriptions,
                                                                               double[][] preparation_times,
                                                                               int max_attribute,
                                                                               java.io.OutputStream out)
                                                                        throws java.lang.Exception
Return an array of AttributeSelection objects that can be applied to instances. This method is called by getDimensionallyReducedInstances during experimentation and returns an array containing each available type of AttributeSelection object. This method is also called directly from Trainer but only an array of size one will be returned and will contain the type of AttributeSelection object that was specified. Note that the given instances are used for training only, and that no dimensionality reduction is applied to them. The given selector_descriptions LinkedList will be erased and filled with descriptions of each of the returned feature selectors.

Parameters:
instances - Instances that may be used to train some feature selectors. These are not altered by this method.
selectors - Contains codes specifying which AttributeSelection objects to be prepared. If called by Experimenter, all possible AttributeSelection objects will be specified. If called by Trainer only one will be specified.
selector_descriptions - This list will be filled with descriptions of the returned feature selectors. Warning: any pre-existing contents will be erased.
preparation_times - The array to be filled with times in seconds needed to prepare each feature selector. The first dimension should have size 1 and the second dimension should be empty.
max_attribute - If the number of attributes for a data set is larger than this number, an exhaustive search will be not be performed.
out - OutputStream to which warning is printed if exhaustive search will not be performed.
Returns:
AttributSelection objects that can be applied to instances for dimensionality reduction.
Throws:
java.lang.Exception - Throws an exception if a problem occurs.