Package unifeat.dataset
Class DatasetInfo
java.lang.Object
unifeat.dataset.DatasetInfo
This java class is used to keep the input data, split input data to
test/train sets and crate CSV file format.
- Author:
- Sina Tabakhi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFeatNames(int[] array) This method creates a string of the names of features in the selected feature arrayString[]This is used to return the names of class labelsString[]This is used to return the names of featuresintThis is used to return number of classes in the datasetintThis is used to return number of samples in the dataset(train set + test set)intThis is used to return number of features in each sampleintThis is used to return number of samples in the test setintThis is used to return number of samples in the train setdouble[][]This is used to return the test set valuesdouble[][]This is used to return the train set valuesbooleanThis is used to return the status of train/test setsbooleanThis is used to return the status of the class label filebooleanThis is used to return the status of the datasetbooleanThis is used to return the status of the samples' classvoidpreProcessing(String path1, String path2) This is used to read dataset and class label files, split datasets and set their valuesvoidpreProcessing(String path1, String path2, String path3) This is used to read datasets and class labels, split datasets and set their values
-
Constructor Details
-
DatasetInfo
public DatasetInfo()
-
-
Method Details
-
preProcessing
This is used to read dataset and class label files, split datasets and set their values- Parameters:
path1- the path of the datasetspath2- the path of the class labels
-
preProcessing
This is used to read datasets and class labels, split datasets and set their values- Parameters:
path1- the path of the train setpath2- the path of the test setpath3- the path of the class labels
-
isCorrectDataset
public boolean isCorrectDataset()This is used to return the status of the dataset- Returns:
- true if the dataset file is in the correct format
-
isCorrectClassLabel
public boolean isCorrectClassLabel()This is used to return the status of the class label file- Returns:
- true if the class labels file is in the correct format
-
isCorrectSamplesClass
public boolean isCorrectSamplesClass()This is used to return the status of the samples' class- Returns:
- true if the the class labels of the samples is valid
-
isCompatibleTrainTestSet
public boolean isCompatibleTrainTestSet()This is used to return the status of train/test sets- Returns:
- true if the train and test sets are compatible
-
getNumData
public int getNumData()This is used to return number of samples in the dataset(train set + test set)- Returns:
- number of samples
-
getNumFeature
public int getNumFeature()This is used to return number of features in each sample- Returns:
- number of features
-
getNumTrainSet
public int getNumTrainSet()This is used to return number of samples in the train set- Returns:
- number of samples in the train set
-
getNumTestSet
public int getNumTestSet()This is used to return number of samples in the test set- Returns:
- number of samples in the test set
-
getNumClass
public int getNumClass()This is used to return number of classes in the dataset- Returns:
- number of classes in the dataset
-
getClassLabel
This is used to return the names of class labels- Returns:
- the array of class labels' names
-
getTrainSet
public double[][] getTrainSet()This is used to return the train set values- Returns:
- the matrix of train set
-
getTestSet
public double[][] getTestSet()This is used to return the test set values- Returns:
- the matrix of test set
-
getNameFeatures
This is used to return the names of features- Returns:
- the array of features' names
-
createFeatNames
This method creates a string of the names of features in the selected feature array- Parameters:
array- the array of indices of the selected features- Returns:
- a string of the integer array
-