|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.ObjectInstances
coser.datamodel.decisionsystem.RoughDecisionSystem
coser.datamodel.decisionsystem.CostSensitiveDecisionSystem
coser.datamodel.decisionsystem.NumericDecisionSystem
coser.datamodel.decisionsystem.DecisionSystemNeighborhood
coser.datamodel.decisionsystem.TestCostDecisionSystemNeighborhood
coser.datamodel.decisionsystem.TestCostSensitiveDSNHGA
public class TestCostSensitiveDSNHGA extends TestCostDecisionSystemNeighborhood
Project: The cost-sensitive rough sets project.
Summary: Test cost sensitive decision system with genetic algorithms for numeric data. Note that, the method is unsatisfactory. We may improve it later. They are written independently because those programs belong to different authors.
Author: Shujiao Liao sjliao2011@163.com
Copyright: The source code and all documents are open and free. PLEASE keep this header while revising the program.
Organizaion: Lab of Granular Computing, Zhangzhou Normal University, Fujian 363000, China.
Progress: Test-cost-sensitive attribute reduction based on genetic algorithms
implemented.
Written time: July 25, 2011.
Last modify time: September 2, 2011.
| 修饰符 和 类型 | 字段 和 描述 |
|---|---|
(专用软件包) long |
bestChromosome
The best fitness value of the chromosome. |
(专用软件包) double |
bestFitnessValue
The best fitness value of the group of chromosomes. |
(专用软件包) long[] |
candidateReductArray
The candidate reducts. |
(专用软件包) boolean[][] |
chromosomes
The population. |
(专用软件包) int |
computeCoreTime
The numericCore runTime |
(专用软件包) boolean[] |
coreAttributes
The boolean coreAttributes array |
(专用软件包) java.lang.String |
distributionString
The name of distribution. |
(专用软件包) java.lang.String |
GAFilename
The gred filename. |
(专用软件包) int |
generations
The max generation. |
(专用软件包) int |
numberOfCandidateReducts
The number of candidate reducts. |
(专用软件包) int |
numberOfChromosomes
The number of Chromosomes. |
(专用软件包) int |
numberOfOne
The number of 1 in the given boolean conditional attribute array |
(专用软件包) int |
runTime
The geneticAlgorithmBasedTCSAttributeReduction runTime |
(专用软件包) boolean |
weighting
Weighting or not. |
| 从类 coser.datamodel.decisionsystem.TestCostDecisionSystemNeighborhood 继承的字段 |
|---|
normalizedIndividualTestCostArray, testCostSum |
| 从类 coser.datamodel.decisionsystem.DecisionSystemNeighborhood 继承的字段 |
|---|
array_tmp, candidateReductsArray, dependency, GranuleDistribution, granuleRangeArray, isItNormalized, lambda, POSsize, sample_lft |
| 从类 coser.datamodel.decisionsystem.NumericDecisionSystem 继承的字段 |
|---|
d, data_array, delta, sqare_distance |
| 构造函数 和 描述 |
|---|
TestCostSensitiveDSNHGA(TestCostDecisionSystemNeighborhood paraDecisionSystem)
Construct the decision system. |
| 修饰符 和 类型 | 方法 和 描述 |
|---|---|
boolean[][] |
bestInsteadOfWorst(boolean[][] paraChromosomes)
The worst individual in offsprings is replaced by & the best individual in parent generation. |
double |
computeExceedingFactor()
Get the exceeding factor. |
double |
computeFitnessValue_FirstVersion(boolean[] paraChromosome,
int paraMaxPositiveRegion,
double paraLambda)
Compute the fitness of the given chromosome in the first version of the genetic algorithm. |
double |
computeFitnessValue_SecondVersion(boolean[] paraChromosome,
int paraMaxPositiveRegion,
double paraLambda)
Compute the fitness of the given chromosome in the second version of the genetic algorithm. |
double |
computeFitnessValue(boolean[] paraChromosome,
int paraMaxPositiveRegion)
Compute the fitness of the given chromosome. |
int |
computeTestCost(long paraSelectedTests)
Compute the cost of selected tests. |
boolean[][] |
crossoverOperation(boolean[][] paraChromosomes)
Uniform crossover. |
long[] |
GABasedMinimalAttributeReduction()
Find a (possibly) minimal reduct using the genetic algorithm based reduction algorithm. |
void |
geneticAlgorithmBasedTCSAttributeReduction_FirstVersion(double paraLambda)
The first version of the genetic algorithm. |
void |
geneticAlgorithmBasedTCSAttributeReduction_SecondVersion(double paraLambda)
The second version of the genetic algorithm. |
boolean[] |
geneticAlgorithmBasedTCSAttributeReduction(double paraLambda,
boolean paraAlgorithm)
Find a (possibly) minimal test-cost reduct using the genetic algorithm based reduction algorithm. |
java.lang.String |
getGAFilename()
Get the GA filename. |
boolean[] |
initializeChromosome(boolean[] paraAllAttributes)
Initialize a chromosome. |
boolean[][] |
initializeChromosomes(boolean[] paraAllAttributes)
Initialize a group of chromosomes. |
void |
initializePartOfChromosomesToTrue()
If no chromosome is a solution, then initialize a part of chromosomes(one tenth) to all true. |
void |
initializePopulation()
Initialize a population. |
boolean |
isCurrentReductOptimal()
Is the current reduct optimal? |
boolean[][] |
mutationOperation(boolean[][] paraChromosomes)
Mutation operation. |
boolean[] |
numericCore()
Compute the core of numeric attribute set |
void |
refreshTestCost()
Refresh the test-cost settings. |
long[] |
removeRedundantReducts()
Remove redundant candidate reducts. |
int |
searchPairsOfChromosomes(boolean[] paraCheckChromosome)
Select a chromosomes for crossover. |
boolean[][] |
selectionOperation_FirstVersion(boolean[][] paraChromosomes,
int paraMaxPositiveRegion,
double paraLambda)
Select new the group of chromosomes in the first version of the genetic algorithm. |
boolean[][] |
selectionOperation_SecondVersion(boolean[][] paraChromosomes,
int paraMaxPositiveRegion,
double paraLambda)
Select new the group of chromosomes in the second version of the genetic algorithm. |
boolean[][] |
selectionOperation(boolean[][] paraChromosomes,
int paraMaxPositiveRegion)
Select new the group of chromosomes. |
void |
setGAFilename()
Set the filename such that it can store results produced by GABasedTCSAttributeReduction. |
void |
setGeneration(int paraGenerations)
Set the number of generation. |
void |
setNumberOfChromosomes(int paraNumberOfChromosome)
Set the number of chromosome. |
void |
setWeighting(boolean paraWeighting)
Set the weighting option for lambda-weighted reduction. |
char |
subSetCheck(long[] paraCandidateSubReducts,
int fisrt,
int second)
Check Who is who's subset. |
| 从类 coser.datamodel.decisionsystem.DecisionSystemNeighborhood 继承的方法 |
|---|
assignment, buildCandidatesBacktrack, computeAllReductsBacktrack, dataMatrixOfBooleanAttribute, getGranuleRangeArray, isNormalized, isNormalizedJudge, numOne, POSsizeAndDependency, setGranuleRangeArray, setGranuleRangeArray |
| 从类 coser.datamodel.decisionsystem.NumericDecisionSystem 继承的方法 |
|---|
allReductsToString, buildCandidatesNHBacktrack, computeAllReductsNHBacktrack, getDelta, removeSuperReducts, setDelta, toDoubleMatrix, toString, writeAllReducts1 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 字段详细信息 |
|---|
int numberOfChromosomes
int generations
double bestFitnessValue
long bestChromosome
boolean[][] chromosomes
long[] candidateReductArray
int numberOfCandidateReducts
java.lang.String distributionString
java.lang.String GAFilename
boolean weighting
int numberOfOne
boolean[] coreAttributes
int runTime
int computeCoreTime
| 构造方法详细信息 |
|---|
public TestCostSensitiveDSNHGA(TestCostDecisionSystemNeighborhood paraDecisionSystem)
throws java.io.IOException,
java.lang.Exception
java.io.IOExceptionjava.lang.Exception| 方法详细信息 |
|---|
public void refreshTestCost()
throws java.lang.Exception
TestCostDecisionSystemNeighborhood 中的 refreshTestCostjava.lang.Exceptionpublic void setWeighting(boolean paraWeighting)
public void setNumberOfChromosomes(int paraNumberOfChromosome)
paraNumberOfChromosome - The number you need.public void setGeneration(int paraGenerations)
paraGenerations - The number you need.public void setGAFilename()
public java.lang.String getGAFilename()
public boolean[] geneticAlgorithmBasedTCSAttributeReduction(double paraLambda,
boolean paraAlgorithm)
throws java.lang.Exception
paraLambda - The given lambda value.paraAlgorithm - Algorithms choice.java.lang.Exception
public void initializePopulation()
throws java.lang.Exception
java.lang.Exception
public boolean[] initializeChromosome(boolean[] paraAllAttributes)
throws java.lang.Exception
paraAllAttributes - All conditional attribubes.java.lang.Exception
public boolean[][] initializeChromosomes(boolean[] paraAllAttributes)
throws java.lang.Exception
paraAllAttributes - The given attributes are not core.java.lang.Exception
public void initializePartOfChromosomesToTrue()
throws java.lang.Exception
java.lang.Exception
public void geneticAlgorithmBasedTCSAttributeReduction_FirstVersion(double paraLambda)
throws java.lang.Exception
paraLambda - The given lambda value.java.lang.Exception
public boolean[][] selectionOperation_FirstVersion(boolean[][] paraChromosomes,
int paraMaxPositiveRegion,
double paraLambda)
throws java.lang.Exception
paraChromosomes - The given chromosomes.paraMaxPositiveRegion - The candinality of the positive region of the decision.paraLambda - The lambad value.java.lang.Exception
public double computeFitnessValue_FirstVersion(boolean[] paraChromosome,
int paraMaxPositiveRegion,
double paraLambda)
throws java.lang.Exception
paraChromosome - The given chromosome.paraMaxPositiveRegion - The candinality of the positive region of the decision.paraLambda - The lambad value.java.lang.Exception
public void geneticAlgorithmBasedTCSAttributeReduction_SecondVersion(double paraLambda)
throws java.lang.Exception
paraLambda - The given lambda value.java.lang.Exception
public boolean[][] selectionOperation_SecondVersion(boolean[][] paraChromosomes,
int paraMaxPositiveRegion,
double paraLambda)
throws java.lang.Exception
paraChromosomes - The given chromosomes.paraMaxPositiveRegion - The candinality of the positive region of the decision.paraLambda - The lambad value.java.lang.Exception
public double computeFitnessValue_SecondVersion(boolean[] paraChromosome,
int paraMaxPositiveRegion,
double paraLambda)
throws java.lang.Exception
paraChromosome - The given chromosome.paraMaxPositiveRegion - The candinality of the positive region of the decision.paraLambda - The lambad value.java.lang.Exception
public boolean[][] crossoverOperation(boolean[][] paraChromosomes)
throws java.lang.Exception
paraChromosomes - The given group of chromosomes.java.lang.Exception
public int searchPairsOfChromosomes(boolean[] paraCheckChromosome)
throws java.lang.Exception
paraCheckChromosome - The given checked of chromosomes.java.lang.Exception
public boolean[][] mutationOperation(boolean[][] paraChromosomes)
throws java.lang.Exception
paraChromosomes - The given chromosomes.java.lang.Exception
public boolean[] numericCore()
throws java.lang.Exception
java.lang.Exception
public long[] GABasedMinimalAttributeReduction()
throws java.lang.Exception
java.lang.Exception
public double computeFitnessValue(boolean[] paraChromosome,
int paraMaxPositiveRegion)
throws java.lang.Exception
paraChromosome - The given chromosomejava.lang.Exception
public boolean[][] selectionOperation(boolean[][] paraChromosomes,
int paraMaxPositiveRegion)
throws java.lang.Exception
paraChromosomes - The given chromosomes.java.lang.Exception
public long[] removeRedundantReducts()
throws java.lang.Exception
java.lang.Exception
public boolean[][] bestInsteadOfWorst(boolean[][] paraChromosomes)
throws java.lang.Exception
paraChromosomes - The given popution.java.lang.Exception
public double computeExceedingFactor()
throws java.lang.Exception
CostSensitiveDecisionSystem 中的 computeExceedingFactorexception - if the optimal reduct is not obtained yet.java.lang.Exception
public int computeTestCost(long paraSelectedTests)
throws java.lang.Exception
CostSensitiveDecisionSystem 中的 computeTestCostparaSelectedTests - which tests are selected, represented by an integer.exception - if the optimal reduct is not obtained yet.java.lang.ExceptionCostSensitiveDecisionSystem.computeTestCost(boolean[])
public boolean isCurrentReductOptimal()
throws java.lang.Exception
java.lang.Exception - if the reduct or the set of all reducts not computed yet.
public char subSetCheck(long[] paraCandidateSubReducts,
int fisrt,
int second)
paraCandidateSubReducts - The long array of CandidateSubReducts.fisrt - the first set.second - the second set.
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||