|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.example.Tools
public class Tools
Provides some tools for calculation of certain measures and feature generation.
| Constructor Summary | |
|---|---|
Tools()
|
|
| Method Summary | |
|---|---|
static void |
checkAndCreateIds(ExampleSet es)
The example set has to have ids. |
static boolean |
compatible(Attribute first,
Attribute second)
Returns true if value and block types of the first attribute are subtypes of value and block type of the second. |
static boolean |
containsValueType(ExampleSet exampleSet,
int valueType)
|
static Attribute[] |
createRegularAttributeArray(ExampleSet exampleSet)
|
static Attribute |
createSpecialAttribute(ExampleSet exampleSet,
java.lang.String name,
int valueType)
|
static Attribute |
createWeightAttribute(ExampleSet exampleSet)
|
static void |
fillTableWithRandomValues(ExampleTable exampleTable,
ExampleSet baseSet,
RandomGenerator random)
After creation of a new MemoryExampleTable with given size all values are Double.NaN. |
static java.lang.String[] |
getAllAttributeNames(ExampleSet exampleSet)
|
static double |
getAverageWeight(AttributeWeightedExampleSet exampleSet)
|
static double[] |
getInverseProbabilitiesFromWeights(Attribute[] attributes,
AttributeWeightedExampleSet exampleSet)
|
static ExampleSet |
getLinearSubsetCopy(ExampleSet exampleSet,
int size,
int offset)
Returns a new example set based on a fresh memory example table sampled from the given set. |
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,
java.lang.String[] functions,
java.util.Random random)
|
static java.lang.String[] |
getRegularAttributeConstructions(ExampleSet exampleSet)
|
static java.lang.String[] |
getRegularAttributeNames(ExampleSet exampleSet)
|
static ExampleSet |
getShuffledSubsetCopy(ExampleSet exampleSet,
int size,
RandomGenerator randomGenerator)
Returns a new example set based on a fresh memory example table sampled from the given set. |
static Attribute[] |
getWeightedCompatibleAttributes(AttributeWeightedExampleSet exampleSet,
FeatureGenerator generator,
java.lang.String[] functions,
RandomGenerator random)
|
static void |
hasNominalLabels(ExampleSet es)
The example set has to have nominal labels. |
static boolean |
isDefault(double defaultValue,
double value)
|
static void |
isIdTagged(ExampleSet es)
The example set has to be tagged with ids. |
static void |
isLabelled(ExampleSet es)
The example set has to contain labels. |
static void |
isNonEmpty(ExampleSet es)
The example set has to contain at least one example. |
static void |
onlyNominalAttributes(ExampleSet es,
java.lang.String task)
The attributes all have to be nominal or binary. |
static void |
onlyNonMissingValues(ExampleSet exampleSet,
java.lang.String task)
The data set is not allowed to contain missing values. |
static void |
onlyNumericalAttributes(ExampleSet es,
java.lang.String task)
The attributes all have to be numerical. |
static void |
replaceValue(Attribute attribute,
java.lang.String oldValue,
java.lang.String newValue)
Replaces the given real value by the new one. |
static void |
replaceValue(ExampleSet exampleSet,
Attribute attribute,
double oldValue,
double newValue)
Replaces the given real value by the new one. |
static void |
replaceValue(ExampleSet exampleSet,
Attribute attribute,
java.lang.String oldValue,
java.lang.String newValue)
Replaces the given value by the new one. |
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 |
|---|
public Tools()
| Method Detail |
|---|
public static void fillTableWithRandomValues(ExampleTable exampleTable,
ExampleSet baseSet,
RandomGenerator random)
public static java.lang.String[] getAllAttributeNames(ExampleSet exampleSet)
public static java.lang.String[] getRegularAttributeNames(ExampleSet exampleSet)
public static java.lang.String[] getRegularAttributeConstructions(ExampleSet exampleSet)
public static Attribute[] createRegularAttributeArray(ExampleSet exampleSet)
public static Attribute[] getRandomCompatibleAttributes(ExampleSet exampleSet,
FeatureGenerator generator,
java.lang.String[] functions,
java.util.Random random)
public static Attribute[] getWeightedCompatibleAttributes(AttributeWeightedExampleSet exampleSet,
FeatureGenerator generator,
java.lang.String[] functions,
RandomGenerator random)
public static Attribute createSpecialAttribute(ExampleSet exampleSet,
java.lang.String name,
int valueType)
public static Attribute createWeightAttribute(ExampleSet exampleSet)
public static boolean containsValueType(ExampleSet exampleSet,
int valueType)
public static void replaceValue(Attribute attribute,
java.lang.String oldValue,
java.lang.String newValue)
public static void replaceValue(ExampleSet exampleSet,
Attribute attribute,
java.lang.String oldValue,
java.lang.String newValue)
public static void replaceValue(ExampleSet exampleSet,
Attribute attribute,
double oldValue,
double newValue)
public static boolean compatible(Attribute first,
Attribute second)
public static double getAverageWeight(AttributeWeightedExampleSet exampleSet)
public static double[] getProbabilitiesFromWeights(Attribute[] attributes,
AttributeWeightedExampleSet exampleSet)
public static double[] getInverseProbabilitiesFromWeights(Attribute[] attributes,
AttributeWeightedExampleSet exampleSet)
public static double[] getProbabilitiesFromWeights(Attribute[] attributes,
AttributeWeightedExampleSet exampleSet,
boolean inverse)
public static Attribute selectAttribute(Attribute[] attributes,
double[] probs,
java.util.Random random)
public static boolean isDefault(double defaultValue,
double value)
public static void onlyNonMissingValues(ExampleSet exampleSet,
java.lang.String task)
throws OperatorException
OperatorException
public static void onlyNumericalAttributes(ExampleSet es,
java.lang.String task)
throws OperatorException
es - the example set
OperatorException
public static void onlyNominalAttributes(ExampleSet es,
java.lang.String task)
throws OperatorException
es - the example set
OperatorException
public static void isLabelled(ExampleSet es)
throws OperatorException
es - the example set
OperatorException
public static void isIdTagged(ExampleSet es)
throws OperatorException
es - the example set
OperatorException
public static void checkAndCreateIds(ExampleSet es)
throws OperatorException
es - the example set
OperatorException
public static void hasNominalLabels(ExampleSet es)
throws OperatorException
es - the example set
OperatorException
public static void isNonEmpty(ExampleSet es)
throws OperatorException
es - the example set
OperatorException
public static ExampleSet getLinearSubsetCopy(ExampleSet exampleSet,
int size,
int offset)
public static ExampleSet getShuffledSubsetCopy(ExampleSet exampleSet,
int size,
RandomGenerator randomGenerator)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||