jAudioFeatureExtractor.Aggregators
Class AggregatorContainer

java.lang.Object
  extended by jAudioFeatureExtractor.Aggregators.AggregatorContainer

public class AggregatorContainer
extends java.lang.Object

Container object that handles the creation of aggregators. Encapsulates the process of matching aggregators to feature sets, calulating the content of aggregators from feature output, and the output of per-file data.

Author:
Daniel McEnnis

Constructor Summary
AggregatorContainer()
          Construct a new, empty container.
 
Method Summary
 void add(Aggregator[] aggs)
          Sets the aggregators to be used in per-file extraction.
 void add(FeatureExtractor[] feature)
          Sets the feature set to use in extraction.
 void add(FeatureExtractor[] feature, boolean[] toggle)
          Adds a feature set, but only those that have the same toggle `
 void aggregate(double[][][] values)
          The input of this procedure executes all aggregators across all feature output.
 FeatureDefinition[] getFeatureDefinitions()
          Returns an array of feature definitions.
 int getNumberOfAggregators()
          Returns the number of concrete aggregators produced.
 double[][] getResults()
          Returns a list of results of aggregator results.
 void outputACEFeatureKeyEntries(java.io.DataOutputStream output)
          Output the header file for the ACE machine learning format.
 void outputACEValueEntries(java.io.DataOutputStream output)
          Output the data file of the ACE machine learning format.
 void outputARFFHeaderEntries(java.io.DataOutputStream output)
          Output the headers for the Weka machine learning format.
 void outputARFFValueEntries(java.io.DataOutputStream output)
          Output the content in a Weka data format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregatorContainer

public AggregatorContainer()
Construct a new, empty container.

Method Detail

getNumberOfAggregators

public int getNumberOfAggregators()
Returns the number of concrete aggregators produced. This is usually not the same as the number of aggregators submitted as multiple dimensions of an aggregator's output are typically collpased.


add

public void add(Aggregator[] aggs)
         throws java.lang.Exception
Sets the aggregators to be used in per-file extraction. All aggregators should be fully configured before being added. The building of the final aggregator lists occurs automatically if a feature set is already present.

Throws:
java.lang.Exception

add

public void add(FeatureExtractor[] feature)
         throws java.lang.Exception
Sets the feature set to use in extraction. If the aggregators are already added, the final aggregator list is created automatically.

Throws:
java.lang.Exception

add

public void add(FeatureExtractor[] feature,
                boolean[] toggle)
         throws java.lang.Exception
Adds a feature set, but only those that have the same toggle `

Throws:
java.lang.Exception

getFeatureDefinitions

public FeatureDefinition[] getFeatureDefinitions()
Returns an array of feature definitions. If either the feature list or the aggregator list is not yet added, this function returns an empty array.


aggregate

public void aggregate(double[][][] values)
               throws java.lang.Exception
The input of this procedure executes all aggregators across all feature output. The results are stored internal to each aggregator.

Parameters:
values -
Throws:
java.lang.Exception

outputACEFeatureKeyEntries

public void outputACEFeatureKeyEntries(java.io.DataOutputStream output)
                                throws java.lang.Exception
Output the header file for the ACE machine learning format.

Parameters:
output - location to put the final output.
Throws:
java.lang.Exception - IO error occurs in processing.

outputACEValueEntries

public void outputACEValueEntries(java.io.DataOutputStream output)
                           throws java.lang.Exception
Output the data file of the ACE machine learning format.

Parameters:
output - location to put the final output data in.
Throws:
java.lang.Exception - IO Error occurs in processing.

outputARFFHeaderEntries

public void outputARFFHeaderEntries(java.io.DataOutputStream output)
                             throws java.lang.Exception
Output the headers for the Weka machine learning format.

Parameters:
output - data stream to place output header info to.
Throws:
java.lang.Exception

outputARFFValueEntries

public void outputARFFValueEntries(java.io.DataOutputStream output)
                            throws java.lang.Exception
Output the content in a Weka data format.

Parameters:
output - data stream to place the Weka data in.
Throws:
java.lang.Exception - IO error occurs.

getResults

public double[][] getResults()
Returns a list of results of aggregator results. If no results exist yet, the results should be the empty set, but is dependent on the aggregator class. If the list is not yet defined, the results are an empty array.