public class DoubleTransposedDataSet
extends java.lang.Object
Set of data of a problem (Transposed).
Modifier and Type | Field and Description |
---|---|
protected double[][] |
array
Array with all data
|
protected double |
maximumDistance
Maximum distance between data
|
protected int |
nofinputs
Number of inputs
|
protected int |
nofobservations
Number of observations (Matrix columns)
|
protected int |
nofoutputs
Number of outputs
|
protected int |
nofvariables
Number of variables (Matrix rows)
|
protected double[] |
outputMeans
Array with the mean of each output
|
Constructor and Description |
---|
DoubleTransposedDataSet()
Empty constructor
|
Modifier and Type | Method and Description |
---|---|
void |
calculateMeans()
Obtain the means of all the outputs
|
void |
configure(Configuration settings)
Configuration parameters for this data set are:
[@file-name] (String)
File name. |
DoubleTransposedDataSet |
copy()
Returns a copy of the DataSet
|
double[][] |
getAllInputs()
Returns a matrix with all the inputs of the dataSet
in rows
|
double[][] |
getAllOutputs()
Returns a matrix with all the outputs of the dataSet
in rows.
|
java.lang.String |
getFileName()
Returns the filename used to read the observations and parameters
|
double[] |
getInputs(int nofobservation)
Returns the inputs of an specified observation
|
double |
getMaximumDistance()
Returns the maximum distance between train data
|
double |
getMaxValueOf(int index)
Returns the maximum value of a specific variable
|
double |
getMinValueOf(int index)
Returns the minimum value of a specific variable
|
int |
getNofinputs()
Returns the number of inputs of the observations stored in the data set
|
int |
getNofobservations()
Returns the number of observations stored in the data set
|
int |
getNofoutputs()
Returns the number of outputs of the observations stored in the data set
|
int |
getNofvariables()
Returns the number of variables stored in the data set
|
double[] |
getObservation(int nofobservation)
Returns an specified observation
|
double[] |
getObservationsOf(int nofvariable)
Returns all the values of a variable in the data set
|
double[] |
getOutput(int nofoutput)
Returns all the values of an output in the data set
|
double |
getOutputMean(int index)
Returns the mean of a specific number of output
|
double[] |
getOutputs(int nofobservation)
Returns the outputs of an specified observation
|
boolean[] |
obtainConstantsInputs()
Obtain a boolean array with true at these inputs that are constants
|
void |
read()
Init the array stored in the DataSet
|
void |
read(byte[] schema,
IDataset dataset)
Init the DoubleTransposedDataSet using a normal IDataset
|
void |
removeInputs(boolean[] toRemove,
int newNofinputs)
Remove the inputs desired
|
void |
setFileName(java.lang.String fileName)
Sets the filename used to read the observations and parameters
|
void |
setMaximumDistance(double maximumDistance)
Sets the maximum distance between train data
|
void |
setNofinputs(int nofinputs)
Sets the number of inputs of the observations stored in the data set
|
void |
setNofobservations(int nofobservations)
Sets the number of observations stored in the data set
|
void |
setNofoutputs(int nofoutputs)
Sets the number of outputs of the observations stored in the data set
|
void |
setNofvariables(int nofvariables)
Sets the number of variables stored in the data set
|
void |
setObservation(int nofobservation,
double[] observation)
Sets an specified observation
|
void |
setObservationsOf(int nofvariable,
double[] values)
Sets all the values of a variable in the data set
|
void |
setOutput(int nofoutput,
double[] values)
Sets all the values of an output in the data set
|
java.lang.String |
toString()
Returns a string representation of the DataSet
|
protected int nofobservations
protected int nofvariables
protected int nofinputs
protected int nofoutputs
protected double[][] array
protected double[] outputMeans
protected double maximumDistance
public java.lang.String getFileName()
Returns the filename used to read the observations and parameters
public void setFileName(java.lang.String fileName)
Sets the filename used to read the observations and parameters
fileName
- Filenamepublic int getNofinputs()
Returns the number of inputs of the observations stored in the data set
public void setNofinputs(int nofinputs)
Sets the number of inputs of the observations stored in the data set
nofinputs
- New number of inputspublic int getNofobservations()
Returns the number of observations stored in the data set
public void setNofobservations(int nofobservations)
Sets the number of observations stored in the data set
nofobservations
- New number of observationspublic int getNofvariables()
Returns the number of variables stored in the data set
public void setNofvariables(int nofvariables)
Sets the number of variables stored in the data set
nofvariables
- New number of variablespublic int getNofoutputs()
Returns the number of outputs of the observations stored in the data set
public void setNofoutputs(int nofoutputs)
Sets the number of outputs of the observations stored in the data set
nofoutputs
- New number of outputspublic double[] getObservation(int nofobservation)
Returns an specified observation
nofobservation
- Number of observation to returnpublic void setObservation(int nofobservation, double[] observation)
Sets an specified observation
nofobservation
- Number of observationobservation
- New observationpublic double[] getOutputs(int nofobservation)
Returns the outputs of an specified observation
nofobservation
- Number of the observationpublic double[][] getAllOutputs()
Returns a matrix with all the outputs of the dataSet in rows.
public double[] getInputs(int nofobservation)
Returns the inputs of an specified observation
nofobservation
- Number of the observationpublic double[][] getAllInputs()
Returns a matrix with all the inputs of the dataSet in rows
public double[] getOutput(int nofoutput)
Returns all the values of an output in the data set
nofoutput
- Number of the outputpublic void setOutput(int nofoutput, double[] values)
Sets all the values of an output in the data set
nofoutput
- Number of the outputvalues
- Double array with all the values of the outputpublic double[] getObservationsOf(int nofvariable)
Returns all the values of a variable in the data set
nofvariable
- Number of the variablepublic void setObservationsOf(int nofvariable, double[] values)
Sets all the values of a variable in the data set
nofvariable
- Number of the variablevalues
- Double array with all the values of the variablepublic double getOutputMean(int index)
Returns the mean of a specific number of output
index
- Number of output mean to returnpublic double getMaxValueOf(int index)
Returns the maximum value of a specific variable
index
- Number of variable maximum value to returnpublic double getMinValueOf(int index)
Returns the minimum value of a specific variable
index
- Number of variable minimum value to returnpublic double getMaximumDistance()
Returns the maximum distance between train data
public void setMaximumDistance(double maximumDistance)
Sets the maximum distance between train data
maximumDistance
- New maximum distancepublic void read(byte[] schema, IDataset dataset) throws DatasetException
Init the DoubleTransposedDataSet using a normal IDataset
schema
- Schema of the datasetdataset
- Dataset to read data ofDatasetException
public void read() throws java.io.IOException, java.lang.NumberFormatException
Init the array stored in the DataSet
IOException,
- NumberFormatExceptionjava.io.IOException
java.lang.NumberFormatException
public void calculateMeans()
Obtain the means of all the outputs
public java.lang.String toString()
Returns a string representation of the DataSet
toString
in class java.lang.Object
public DoubleTransposedDataSet copy()
Returns a copy of the DataSet
public boolean[] obtainConstantsInputs()
Obtain a boolean array with true at these inputs that are constants
public void removeInputs(boolean[] toRemove, int newNofinputs)
Remove the inputs desired
toRemove
- Array of Boolean indicating constant inputs with truenewNofinputs
- New number of inputs of the datasetpublic void configure(Configuration settings)
Configuration parameters for this data set are:
[@file-name] (String)
File name. Name of the file that stores the neccesary information
for this data set.
settings
- Configuration object from which the properties are going to be read