|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.ObjectjAudioFeatureExtractor.ACE.DataTypes.DataSet
public class DataSet
Objects of this class each hold feature values for an item to be classified. Methods are including for displaying these values as formatted strings, saving them to disk or loading them to disk. A method is also available for reconciling these objects with FeatureDefinition objects. Methods are also available for extracting feature values in String form.
フィールドの概要 | |
---|---|
java.lang.String[] |
feature_names
The names of the features in each corresponding (by first indice) entry of feature_values. |
double[][] |
feature_values
The feature values for this DataSet as a whole. |
java.lang.String |
identifier
The name of the data set. |
DataSet |
parent
If this object is a sub-set of another DataSet, this field points to that parent dataset. |
double |
start
Identifies the start of a sub-set of a DataSet. |
double |
stop
Identifies the end of a sub-set of a DataSet. |
DataSet[] |
sub_sets
Sub-sets of this DataSet. |
コンストラクタの概要 | |
---|---|
DataSet()
Generate an empty DataSet. |
メソッドの概要 | |
---|---|
java.lang.String |
getDataSetDescription(int depth)
Generate a formatted strind detailing the contents of this DataSet. |
static java.lang.String |
getDataSetDescriptions(DataSet[] dataset)
Returns a formatted text description of the given DataSet objects. |
java.lang.String[][][] |
getFeatureValuesOfSubSections(FeatureDefinition[] definitions)
Returns the feature values stored in the DataSets in the sub_sets field of this object. |
java.lang.String[][] |
getFeatureValuesOfTopLevel(FeatureDefinition[] definitions)
Returns the feature values stored in the feature_values field of this object. |
void |
orderAndCompactFeatures(FeatureDefinition[] definitions,
boolean is_top_level)
Processes this DataSet based on the given definitions parameter. |
static DataSet[] |
parseDataSetFile(java.lang.String data_set_file_path)
Parses a feature_vector_file XML file and returns an array of DataSet objects holding its contents. |
static DataSet[] |
parseDataSetFile(java.lang.String data_set_file_path,
FeatureDefinition[] definitions)
Parses a feature_vector_file XML file and returns an array of DataSet objects holding its contents. |
static DataSet[] |
parseDataSetFiles(java.lang.String[] data_set_file_paths,
FeatureDefinition[] definitions)
Parses a several feature_vector_file XML files and returns an array of DataSet objects holding the combined contents of all of the files. |
static void |
saveDataSets(DataSet[] data_sets,
FeatureDefinition[] definitions,
java.io.File to_save_to,
java.lang.String comments)
Saves a feature_vector_file XML file with the contents specified in the given DataSet array and the comments specified in the comments parameter. |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
public java.lang.String identifier
public DataSet[] sub_sets
public double start
public double stop
public double[][] feature_values
public java.lang.String[] feature_names
public DataSet parent
コンストラクタの詳細 |
---|
public DataSet()
メソッドの詳細 |
---|
public void orderAndCompactFeatures(FeatureDefinition[] definitions, boolean is_top_level) throws java.lang.Exception
This method also processes the sub_sets of this DataSet recursively.
The end result of running this method is that the features in feature_values that are referred to in both feature_names and definitions are given the same order as in definitions. Any features in definitions that are not present in feature_names are set to null in feature_values. Any features in feature_names that are not in definitions are deleted. At the end of running this method, feature_names is null and feature_values has the same number of entries as definitions.
The purpose of running this method is to put this DataSet in a configuration that can be stored and processed more efficiently and to verify the validity of the stored features.
definitions
- The feature definitions to order the
feature_values field by.is_top_level
- True if this DataSet is a top-level DataSet
(i.e. not a sub-set of another DataSet).
This parameter should always be true when
this method is called externally.
java.lang.Exception
- An informative exception is thrown if the
dimensions of a stored feature does not match
the dimensions that it should have according to
its definition. An excpetion is also thrown if
features in the sub_sets that have values of
false for the is_sequential field of the
corresponding FeatureDefinition are present
in the sub-set.public java.lang.String[][] getFeatureValuesOfTopLevel(FeatureDefinition[] definitions)
The returned array is null if no features have been extracted. If a particular feature value is not available, then a question mark is returned in the appropriate entry.
definitions
- Feature definitions that are used to get the
dimensions of unknown features.
public java.lang.String[][][] getFeatureValuesOfSubSections(FeatureDefinition[] definitions)
The returned array is null if no sub-sections are available. The first dimension is null if no features have been extracted for a given sub- section. If a particular feature value is not available, then a question mark is returned in the appropriate entry.
definitions
- Feature definitions that are used to get the
dimensions of unknown features.
public java.lang.String getDataSetDescription(int depth)
depth
- How deep this DataSet is in a hierarchy of DataSets
(i.e. through the sub_sets field). This parameter should
generally be 0 when called externally, as this method
operates recursively.
public static java.lang.String getDataSetDescriptions(DataSet[] dataset)
dataset
- The data sets to describe.
public static DataSet[] parseDataSetFile(java.lang.String data_set_file_path) throws java.lang.Exception
data_set_file_path
- The path of the XML file to parse.
java.lang.Exception
- Informative exceptions is thrown if an
invalid file or file path is specified.public static DataSet[] parseDataSetFile(java.lang.String data_set_file_path, FeatureDefinition[] definitions) throws java.lang.Exception
Also processes each resulting DataSet in order to reconcile it with the given definitions. See the orderAndCompactFeatures method for details.
data_set_file_path
- The path of the XML file to parse.definitions
- FeatureDefinitions to use for formatting
and validating the contents of the file
to be parsed.
java.lang.Exception
- Informative exceptions is thrown if an
invalid file or file path is specified.
An exception is also thrown if the
given feature definitions are incompatible
with the contents of the file.public static DataSet[] parseDataSetFiles(java.lang.String[] data_set_file_paths, FeatureDefinition[] definitions) throws java.lang.Exception
Also processes each resulting DataSet in order to reconcile it with the given definitions. See the orderAndCompactFeatures method for details. This will not occur if the definitions parameter is null.
data_set_file_paths
- The paths of the XML files to parse.definitions
- FeatureDefinitions to use for formatting
and validating the contents of the files
to be parsed.
java.lang.Exception
- Informative exceptions is thrown if an
invalid file or file path is specified.
An exception is also thrown if the
given feature definitions are incompatible
with the contents of a file.public static void saveDataSets(DataSet[] data_sets, FeatureDefinition[] definitions, java.io.File to_save_to, java.lang.String comments) throws java.lang.Exception
In general, it is best to have applied the orderAndCompactFeatures method to data_sets before calling this saveDataSets method.
data_sets
- The DataSets to save.definitions
- The FeatureDefinitions to base feature names
on if they are not present in individual
DataSets. May be null.to_save_to
- The file to save to.comments
- Any comments to be saved inside the comments
element of the XML file.
java.lang.Exception
- An informative exception is thrown if the
file cannot be saved or if feature names
are available in neither individual data_sets
nor in definitions.
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |