Package unifeat.featureSelection
Class FitnessEvaluator
java.lang.Object
unifeat.featureSelection.FitnessEvaluator
This java class is used to implement fitness evaluator of a solution in which
k-fold cross validation on training set is used for evaluating the
classification performance of a selected feature subset.
- Author:
- Sina Tabakhi
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate ClassifierType
private String[]
private int
private String[]
private Object
private final String
private double[][]
-
Constructor Summary
ConstructorDescriptionFitnessEvaluator
(String path, Object classifierName, Object selectedEvaluationClassifierPanel, int kFolds) Initializes the parameters -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method creates a directory based on the specific pathcrossValidation
(int[] selectedFeature) This method performs k-fold cross validation on the reduced training set which is achieved by selected feature subset.void
This method deletes the current directory with all files in the directoryvoid
setDataInfo
(double[][] data, String[] nameFeatures, String[] classLabel) This method sets the information of the dataset.
-
Field Details
-
TEMP_PATH
-
trainSet
private double[][] trainSet -
nameFeatures
-
classLabel
-
selectedEvaluationClassifierPanel
-
classifierType
-
kFolds
private int kFolds
-
-
Constructor Details
-
FitnessEvaluator
public FitnessEvaluator(String path, Object classifierName, Object selectedEvaluationClassifierPanel, int kFolds) Initializes the parameters- Parameters:
path
- the temp path in the projectclassifierName
- the name of given classifierselectedEvaluationClassifierPanel
- panel of the selected classifier contained the parameter valueskFolds
- the number of equal sized subsamples that is used in k-fold cross validation
-
-
Method Details
-
setDataInfo
This method sets the information of the dataset.- Parameters:
data
- the input dataset valuesnameFeatures
- the string array of features namesclassLabel
- the string array of class labels names
-
crossValidation
This method performs k-fold cross validation on the reduced training set which is achieved by selected feature subset.- Parameters:
selectedFeature
- an array of indices of the selected feature subset- Returns:
- the different criteria values
-
createTempDirectory
public void createTempDirectory()This method creates a directory based on the specific path -
deleteTempDirectory
public void deleteTempDirectory()This method deletes the current directory with all files in the directory
-