public abstract class CoevolutionAlgorithm
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected long |
initialTime
Initial time.
|
protected int |
inputAtt
Number of input attributes
|
protected Attribute[] |
inputs
Inputs attributes
|
protected double |
modelTime
Generation model time.
|
protected java.lang.String |
name
Naming.
|
protected int |
nClasses
Number of classes.
|
protected int[] |
nInstances
Number of instances of each classes.
|
protected boolean[] |
nulls
Missing values of a instance
|
protected java.lang.String[] |
outFile
Output files names
|
protected Attribute |
output
Output attribute
|
protected InstanceSet |
reference
Reference dataset
|
protected double[][] |
referenceData
Reference input data.
|
protected java.lang.String |
referenceFile
Reference file name
|
protected int[] |
referenceOutput
Reference output data.
|
protected java.lang.String |
relation
Relation string.
|
protected long |
seed
Random seed.
|
protected Instance |
temp
Temporal instance.
|
protected InstanceSet |
test
Test dataset
|
protected double[][] |
testData
Test input data.
|
protected java.lang.String |
testFile
Test file name
|
protected int[] |
testOutput
Test output data.
|
protected double |
testTime
Test prediction time.
|
protected InstanceSet |
train
Training dataset
|
protected double[][] |
trainData
Training input data.
|
protected java.lang.String |
trainFile
Train file name
|
protected double |
trainingTime
Training prediction time.
|
protected int[] |
trainOutput
Training output data.
|
Constructor and Description |
---|
CoevolutionAlgorithm() |
Modifier and Type | Method and Description |
---|---|
protected double |
euclideanDistance(double[] instance1,
double[] instance2)
Calculates the Euclidean distance between two instances
|
protected void |
normalizeReference()
This function builds the data matrix for reference data and normalizes inputs values
|
protected void |
normalizeTest()
This function builds the data matrix for test data and normalizes inputs values
|
protected void |
normalizeTrain()
This function builds the data matrix for training data and normalizes inputs values
|
static java.lang.String |
printInstance(int[] instance)
Generates a string with the contents of the instance
|
protected void |
readConfiguracion(java.lang.String script)
Reads configuration script, and extracts its contents.
|
protected void |
readDataFiles(java.lang.String script)
Read the configuration and data files, and process it.
|
protected abstract void |
readParameters(java.lang.String script)
Reads the parameters of the algorithm.
|
protected boolean |
same(double[] a,
double[] b)
Checks if two instances are the same
|
protected void |
setInitialTime()
Sets the time counter
|
protected java.lang.String[] outFile
protected java.lang.String testFile
protected java.lang.String trainFile
protected java.lang.String referenceFile
protected InstanceSet train
protected InstanceSet test
protected InstanceSet reference
protected Instance temp
protected int inputAtt
protected Attribute[] inputs
protected Attribute output
protected boolean[] nulls
protected double[][] trainData
protected int[] trainOutput
protected double[][] testData
protected int[] testOutput
protected double[][] referenceData
protected int[] referenceOutput
protected java.lang.String relation
protected int nClasses
protected int[] nInstances
protected long initialTime
protected double modelTime
protected double trainingTime
protected double testTime
protected java.lang.String name
protected long seed
protected void readDataFiles(java.lang.String script)
script
- Name of the configuration scriptprotected void readConfiguracion(java.lang.String script)
script
- Name of the configuration scriptprotected abstract void readParameters(java.lang.String script)
script
- Configuration scriptprotected void normalizeTrain() throws keel.Algorithms.Coevolution.CoevolutionAlgorithm.CheckException
keel.Algorithms.Coevolution.CoevolutionAlgorithm.CheckException
- (if the dataset is not a classification problem)protected void normalizeTest() throws keel.Algorithms.Coevolution.CoevolutionAlgorithm.CheckException
keel.Algorithms.Coevolution.CoevolutionAlgorithm.CheckException
- (if the dataset is not a classification problem)protected void normalizeReference() throws keel.Algorithms.Coevolution.CoevolutionAlgorithm.CheckException
keel.Algorithms.Coevolution.CoevolutionAlgorithm.CheckException
- (if the dataset is not a classification problem)protected double euclideanDistance(double[] instance1, double[] instance2)
instance1
- First instanceinstance2
- Second instanceprotected boolean same(double[] a, double[] b)
a
- First instanceb
- Second instancepublic static java.lang.String printInstance(int[] instance)
instance
- Instance to printprotected void setInitialTime()