edu.udo.cs.yale.example
Class Tools

java.lang.Object
  extended by edu.udo.cs.yale.example.Tools

public class Tools
extends java.lang.Object

Provides some tools for calculation of certain measures and feature generation.

Version:
$Id: Tools.java,v 2.32 2006/08/03 14:39:28 ingomierswa Exp $
Author:
Simon Fischer, Ingo Mierswa

Constructor Summary
Tools()
           
 
Method Summary
static Attribute[] createAttributeArray(ExampleSet exampleSet)
           
static void fillTableWithRandomValues(ExampleTable exampleTable, RandomGenerator random)
          After creation of a new MemoryExampleTable with given size all values are Double.NaN.
static double getAverageWeight(AttributeWeightedExampleSet exampleSet)
           
static double[] getInverseProbabilitiesFromWeights(Attribute[] attributes, AttributeWeightedExampleSet exampleSet)
           
static double[] getProbabilitiesFromWeights(Attribute[] attributes, AttributeWeightedExampleSet exampleSet)
           
static double[] getProbabilitiesFromWeights(Attribute[] attributes, AttributeWeightedExampleSet exampleSet, boolean inverse)
          Calculates probabilities for attribute selection purposes based on the given weight.
static Attribute[] getRandomCompatibleAttributes(ExampleSet exampleSet, FeatureGenerator generator, int maxDepth, java.lang.String[] functions, java.util.Random random)
           
static Attribute[] getWeightedCompatibleAttributes(AttributeWeightedExampleSet exampleSet, FeatureGenerator generator, int maxDepth, java.lang.String[] functions, RandomGenerator random)
           
static Attribute selectAttribute(Attribute[] attributes, double[] probs, java.util.Random random)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tools

public Tools()
Method Detail

fillTableWithRandomValues

public static void fillTableWithRandomValues(ExampleTable exampleTable,
                                             RandomGenerator random)
After creation of a new MemoryExampleTable with given size all values are Double.NaN. Use this method to fill the table with random values in the range specified by minimum and maximum values of the attributes. Please note that the attributes in the example table must already have proper minimum and maximum values. This works only for numerical attribute. Nominal attribute values will be set to 0.


createAttributeArray

public static Attribute[] createAttributeArray(ExampleSet exampleSet)

getRandomCompatibleAttributes

public static Attribute[] getRandomCompatibleAttributes(ExampleSet exampleSet,
                                                        FeatureGenerator generator,
                                                        int maxDepth,
                                                        java.lang.String[] functions,
                                                        java.util.Random random)

getWeightedCompatibleAttributes

public static Attribute[] getWeightedCompatibleAttributes(AttributeWeightedExampleSet exampleSet,
                                                          FeatureGenerator generator,
                                                          int maxDepth,
                                                          java.lang.String[] functions,
                                                          RandomGenerator random)

getAverageWeight

public static double getAverageWeight(AttributeWeightedExampleSet exampleSet)

getProbabilitiesFromWeights

public static double[] getProbabilitiesFromWeights(Attribute[] attributes,
                                                   AttributeWeightedExampleSet exampleSet)

getInverseProbabilitiesFromWeights

public static double[] getInverseProbabilitiesFromWeights(Attribute[] attributes,
                                                          AttributeWeightedExampleSet exampleSet)

getProbabilitiesFromWeights

public static double[] getProbabilitiesFromWeights(Attribute[] attributes,
                                                   AttributeWeightedExampleSet exampleSet,
                                                   boolean inverse)
Calculates probabilities for attribute selection purposes based on the given weight. Attributes whose weight is not defined in the weight vector get a probability corresponding to the average weight. Inverse probabilities can be calculated for cases where attributes with a high weight should be selected with small probability.


selectAttribute

public static Attribute selectAttribute(Attribute[] attributes,
                                        double[] probs,
                                        java.util.Random random)


Copyright © 2001-2006