public class DatasetRegression extends java.lang.Object implements IDataset<double[][],double[]>
| Constructor and Description |
|---|
DatasetRegression(java.lang.String filepath)
Initializes a new instance of the DatasetRegression class.
|
DatasetRegression(java.lang.String name,
double[][] input,
double[] output)
Initializes a new instance of the DatasetClassification class.
|
DatasetRegression(java.lang.String name,
double[][] input,
double[] output,
DecisionVariable[] attributes)
Initializes a new instance of the DatasetClassification class.
|
DatasetRegression(java.lang.String filepath,
java.lang.String name)
Initializes a new instance of the DatasetRegression class.
|
DatasetRegression(java.lang.String filepath,
java.lang.String name,
boolean ignoreAttributeInfo)
Initializes a new instance of the DatasetRegression class.
|
DatasetRegression(java.lang.String filepath,
java.lang.String name,
boolean ignoreAttributeInfo,
int classIndex)
Initializes a new instance of the DatasetRegression class.
|
| Modifier and Type | Method and Description |
|---|---|
static DatasetRegression |
FromCSV(java.lang.String filepath,
java.lang.String name)
Read dataset from a CSV structure.
|
static DatasetRegression |
FromCSV(java.lang.String filepath,
java.lang.String name,
boolean ignoreAttributeInfo)
Read dataset from a CSV structure.
|
static DatasetRegression |
FromCSV(java.lang.String filepath,
java.lang.String name,
boolean ignoreAttributeInfo,
int classIndex)
Construct a dataset from an CSV file.
|
DecisionVariable[] |
getAllDecisionVariables()
Get the decision variables including the output.
|
int |
getClassIndex()
Get class index.
|
DecisionVariable[] |
getDecisionVariables()
Get the decision variables.
|
double[][] |
getInput()
Get the input data.
|
java.lang.String |
getName()
Get the name of the dataset.
|
int |
getNumberOfAttributes()
Get the number of attributes.
|
int |
getNumberOfContinuous()
Get the number of type continuous.
|
int |
getNumberOfDiscrete()
Get the number of type discrete.
|
int |
getNumberOfInstances()
Get the number of instances.
|
double[] |
getOutput()
Get the output data.
|
StatisticsDataset[] |
getStatistics()
Get the statistics from the dataset.
|
void |
KeepAttributes(int[] indexes)
Keep the selected attributes and remove the rest.
|
double[][] |
Normalize()
Normalize all continuous data.
|
double[][] |
Normalize(double min,
double max)
Normalize all continuous data.
|
void |
RemoveAttribute(int index)
Remove an attribute.
|
void |
RemoveAttributes(int[] indexes)
Remove selected attributes.
|
void |
setClassIndex(int classIndex)
Set class index.
|
DatasetRegression |
Split(float percentage)
Split the percentange of the dataset in Trainning and the rest in Validation.
|
DatasetRegression |
Split(float percentage,
java.lang.String name)
Split the percentange of the dataset in Trainning and the rest in Validation.
|
double[][] |
Standartize()
Standartize all continuous data.
|
void |
WriteAsARFF(java.lang.String filename)
Write dataset as ARFF file.
|
void |
WriteAsARFF(java.lang.String filename,
int decimalPlaces)
Write dataset as ARFF file.
|
void |
WriteAsCSV(java.lang.String filename)
Write the dataset as CSV file.
|
void |
WriteAsCSV(java.lang.String filename,
int decimalPlaces)
Write the dataset as CSV file.
|
void |
WriteAsCSV(java.lang.String filename,
int decimalPlaces,
char delimiter)
Write the dataset as CSV file.
|
void |
WriteAsCSV(java.lang.String filename,
int decimalPlaces,
char delimiter,
java.lang.String newLine)
Write the dataset as CSV file.
|
void |
WriteAsCSV(java.lang.String filename,
int decimalPlaces,
char delimiter,
java.lang.String newLine,
boolean writeHeader)
Write the dataset as CSV file.
|
public DatasetRegression(java.lang.String filepath)
filepath - File path.public DatasetRegression(java.lang.String filepath,
java.lang.String name)
filepath - File path.name - Name of the dataset.public DatasetRegression(java.lang.String filepath,
java.lang.String name,
boolean ignoreAttributeInfo)
filepath - File path.name - Name of the data.ignoreAttributeInfo - Ignore attribute information.public DatasetRegression(java.lang.String filepath,
java.lang.String name,
boolean ignoreAttributeInfo,
int classIndex)
filepath - File path.name - Name of the dataset.ignoreAttributeInfo - Ignore attribute information.classIndex - Output index.public DatasetRegression(java.lang.String name,
double[][] input,
double[] output)
name - Name of the dataset.input - Input data.output - Output data.public DatasetRegression(java.lang.String name,
double[][] input,
double[] output,
DecisionVariable[] attributes)
name - Name of the dataset.attributes - Decision variables.input - Input data.output - Output data.public java.lang.String getName()
public double[][] getInput()
public double[] getOutput()
public int getClassIndex()
public void setClassIndex(int classIndex)
classIndex - Class index.public DecisionVariable[] getDecisionVariables()
getDecisionVariables in interface IDataset<double[][],double[]>public DecisionVariable[] getAllDecisionVariables()
public int getNumberOfInstances()
public int getNumberOfAttributes()
public int getNumberOfContinuous()
public int getNumberOfDiscrete()
public static DatasetRegression FromCSV(java.lang.String filepath, java.lang.String name)
filepath - File path.name - Name of the dataset.public static DatasetRegression FromCSV(java.lang.String filepath, java.lang.String name, boolean ignoreAttributeInfo)
filepath - File path.name - Name of the dataset.public static DatasetRegression FromCSV(java.lang.String filepath, java.lang.String name, boolean ignoreAttributeInfo, int classIndex)
filepath - File.name - Name of the dataset.ignoreAttributeInfo - Ignore attribute information.classIndex - Index of the attribute for to be setup as output.public double[][] Normalize()
public double[][] Normalize(double min,
double max)
min - Minimum.max - Maximum.public void RemoveAttribute(int index)
index - Index of the attribute.public void RemoveAttributes(int[] indexes)
indexes - Indexes of the attributes.public void KeepAttributes(int[] indexes)
indexes - Indexes of the attributes.public DatasetRegression Split(float percentage)
percentage - Percentage.public DatasetRegression Split(float percentage, java.lang.String name)
percentage - Percentage.name - Name of the validation dataset.public double[][] Standartize()
public StatisticsDataset[] getStatistics()
IDatasetgetStatistics in interface IDataset<double[][],double[]>public void WriteAsCSV(java.lang.String filename)
filename - Filename.public void WriteAsCSV(java.lang.String filename,
int decimalPlaces)
filename - Filename.decimalPlaces - Decimal places for continous data.public void WriteAsCSV(java.lang.String filename,
int decimalPlaces,
char delimiter)
filename - Filename.decimalPlaces - Decimal places for continous data.delimiter - Delimiter.public void WriteAsCSV(java.lang.String filename,
int decimalPlaces,
char delimiter,
java.lang.String newLine)
filename - Filename.decimalPlaces - Decimal places.delimiter - Delimiter.newLine - Newline char.public void WriteAsCSV(java.lang.String filename,
int decimalPlaces,
char delimiter,
java.lang.String newLine,
boolean writeHeader)
filename - Filename.decimalPlaces - Decimal places.delimiter - Delimiter.newLine - Newline char.writeHeader - Write the header of the dataset.public void WriteAsARFF(java.lang.String filename)
filename - Filename.public void WriteAsARFF(java.lang.String filename,
int decimalPlaces)
filename - Filename.decimalPlaces - Decimal places.