var
Class FSCompare

java.lang.Object
  extended by var.FSCompare

public class FSCompare
extends java.lang.Object

This class is meant to find comparable results between featureselection filters of the full type. Indeed, these filters can be written to a file and then compared, in case the same features are used. An exact match of all the features is requested. While this is not strictly necessary (since we could be able to skip some of them and just compare the relevant classificationfeatures), it does make the program a lot more cleaner and easier to write. Thus, we have opted for this solution.

Author:
Michiel Van Bel

Constructor Summary
FSCompare(java.lang.String[] args)
           
 
Method Summary
 void compareFeatureFiles(FeatureFileContent ffc_1, FeatureFileContent ffc_2)
          This method compares the different contents of the featurefiles.
 java.lang.String explanation(int loc, java.util.List<java.util.List<ValPosCombination>> attrib_list, java.util.List<ClassificationFeature> cfList)
          Generates an explanation for the located feature.
 FeatureFileContent extractContent(java.io.File file)
          This method extracts the content of a featurefile, parses it and then goes on to store it all in one object.
static void main(java.lang.String[] args)
           
 boolean testClassificationFeatures(FeatureFileContent ffc_1, FeatureFileContent ffc_2)
          This method tests whether or not two featurefiles are generated by the same amount and types of classificationfeatures.
 void testSimilarLocations(FeatureFileContent ffc_1, FeatureFileContent ffc_2)
          This method tests the same locations within both contents of featurefiles.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSCompare

public FSCompare(java.lang.String[] args)
Method Detail

main

public static void main(java.lang.String[] args)

compareFeatureFiles

public void compareFeatureFiles(FeatureFileContent ffc_1,
                                FeatureFileContent ffc_2)
This method compares the different contents of the featurefiles. The method first tests whether or not the features are the same, and then goes on to actually test the content of these files if the extracted and defined features are the same. Of course, if there has been manual tampering with the featurefiles in order to make it appear that the same classificationfeatures are used, the program could crash.

Parameters:
ffc_1 - Content of featurefile 1
ffc_2 - Content of featurefile 2

testSimilarLocations

public void testSimilarLocations(FeatureFileContent ffc_1,
                                 FeatureFileContent ffc_2)
This method tests the same locations within both contents of featurefiles. It iterates over all possible features and checks their weights. If both the weights (of the same location of course) are not zero valued, this result is stored. Hereafter, the results are displayed with a possibe combination

Parameters:
ffc_1 - The content of feature file one
ffc_2 - The content of feature file two

explanation

public java.lang.String explanation(int loc,
                                    java.util.List<java.util.List<ValPosCombination>> attrib_list,
                                    java.util.List<ClassificationFeature> cfList)
Generates an explanation for the located feature. It first determines to which classificationfeature the extracted feature belongs, and it then goes on determine what position the feature has within this classificationfeature. At last, with this location found

Parameters:
loc - Location in the total featurelist (can thus reach very high values)
attrib_list - Double nested list which determines the ranges of the classificationfeatures
cfList - The list with used classificationfeatures
Returns:
String with an explanation

testClassificationFeatures

public boolean testClassificationFeatures(FeatureFileContent ffc_1,
                                          FeatureFileContent ffc_2)
This method tests whether or not two featurefiles are generated by the same amount and types of classificationfeatures.

Parameters:
ffc_1 - The content of feature file 1
ffc_2 - The content of feature file 2
Returns:
A boolean indicating whether or not both files are generated by the same classification features.

extractContent

public FeatureFileContent extractContent(java.io.File file)
                                  throws java.io.IOException
This method extracts the content of a featurefile, parses it and then goes on to store it all in one object.

Parameters:
file - The featurefile
Returns:
An object with the parsed content of the file: a list with the different defined features and a list with all the locations and their weights
Throws:
java.io.IOException - In case of a file reading exception