|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Partition
Partition
Field Summary | |
static int |
CF_DIV
|
static int |
CF_POW
|
static int |
CF_PROD
|
static int |
CF_SYM_DIFF
|
protected boolean |
cfIsValid
|
protected java.util.Hashtable |
classCard
|
protected java.util.Hashtable |
classCode
|
protected java.util.Hashtable |
classFitness
|
protected int |
classFitnessType
|
protected double |
fitness
|
protected int |
maxNoClasses
|
protected int |
size
|
protected int[] |
v
|
Method Summary | |
void |
adjust(java.util.Random rand)
adjusts this Partition to have exactly getMaxNoClasses() classes |
void |
computeFitness(java.util.Hashtable[] intersectMap,
Partition[] c,
int NPART,
int entropyMeasure,
int fitnessMeasure,
double[] wTargetCondOnDB,
double[] wDBCondOnTarget,
double[] weight)
computes the fitness of this Partition with respect to its intersection to NPART partitions in c ,
available in intersectMap , according to the entropy
measure and distance measure |
void |
computeFitness(Partition[] c,
int NPART,
int entropyMeasure,
int fitnessMeasure,
double[] wTargetCondOnDB,
double[] wDBCondOnTarget,
double[] weight)
computes the fitness of this Partition with respect to the partitions in collection c, according to the entropy measure and distance measure |
static void |
computeInfoIntersections(Partition[] c,
int NPART,
int entropyMeasure,
java.util.Vector v)
fills the vector v with a Double representing the
value of the entropy of the partition determined by the
intersection of all NPART partitions in the
collection c and with an Integer representing the
number of classes of the intersection partition |
static void |
computeIntersections(Partition[] c1,
int NPART1,
Partition[] c2,
int NPART2,
java.util.Hashtable[][] intersectMap)
computes intersections between the classes of partitions in collection c1 and classes of the partitions in
collection c2 |
static void |
computeIntersections(Partition p,
Partition[] c,
int NPART,
java.util.Hashtable[] intersectMap)
computes intersections between the classes of partition p and classes of the partitions in collection
c |
void |
computeSilhouettes(double[] silhouettes,
int[] neighbors,
Partition[] c,
int NPART)
fills the array silhouettes of dimension 'size'
with the silhoutte coefficients, computed with respect to the
classes in this Partition and with respect to the values of the
NPART partitions in collection c ; this
Partition should have at least 2 classes; neighbors
will contain for each rowid the class number of the closest
class |
double |
distSymDiff(Partition c)
|
double |
entropy(int entropyMeasure)
|
double |
entropyIntersect(Partition p,
int entropyMeasure)
|
static double |
estimateWeights(Partition[] db,
int NPART,
double sampleDBPct,
int entropyMeasure,
double[] wTargetCondOnDB,
double[] wDBCondOnTarget,
double[] weight,
java.util.Random rand)
estimates the degree in which the other partitions in db influences the target partition; the target
partition should be the last partition in db ;
sampleDBPct specifies the percent of the database to
be sampled; sets wTargetCondonDB[i] to
H(db[i]|db[target]) and sets the wDBCondOnTarget[i]
to H(db[target]|db[i]); sets weight[i] to
wTargetCondOnDB[i]+wDBCondOnTarget[i] |
int |
get(int rowid)
|
void |
getAM(java.util.Hashtable[] am)
fills an array of Hashtable objects, am , with the
array representation of the partition; in this array each class
corresponds to an index in the array; the contents of the array
at that index is a Hashtable with the rowids where the class
appears in the partition |
int |
getClassCard(int c)
|
java.lang.Integer |
getClassCode(java.lang.String classOrig)
|
java.lang.String |
getClassesAndCardinalities()
returns a String containing a list of classes of this Partition and their cardinalities |
double |
getClassFitness(int c)
|
int |
getClassFitnessType()
|
double |
getClassifRate(Partition target)
|
java.util.ArrayList |
getClassIntersections(Partition target)
|
double |
getFitness()
|
int |
getMaxNoClasses()
|
int |
getNoClasses()
|
int |
getSize()
|
boolean |
hasClassCode(java.lang.String classOrig)
|
void |
init(java.util.Random rand)
randomly initializes this Partition |
boolean |
isEqual(Partition p)
|
static void |
main(java.lang.String[] args)
|
void |
plotSilhouettes(double[] silhouettes,
int[] neighbors)
plots a graphical representation of the silhouettes; classes are plotted in order and the elements in the classes are plotted in decreasing order of their silhouette |
void |
plotSilhouettes(double[] silhouettes,
int[] neighbors,
java.lang.StringBuffer output)
appends to output a graphical representation of the
silhouettes; classes are plotted in order and the elements in the
classes are plotted in decreasing order of their silhouette |
protected void |
print()
prints this Partition as an array of integers |
protected void |
print(java.lang.StringBuffer output)
appends contents of this Partition as an array of integers to output |
void |
printAM()
prints this Partition as an array of a collection of rowids |
void |
printClassCardinalities()
prints cardinalities of the classes of this Partition |
void |
printClassCardinalities(java.lang.StringBuffer output)
appends cardinalities of the classes of this Partition to the output |
void |
printClassFitness()
prints the class fitness values |
void |
printClassInfo()
prints information about the classes of this Partition |
void |
printInfo(Partition[] db,
int NPART,
double[] wTargetCondOnDB,
double[] wDBCondOnTarget,
double[] weight,
int entropyMeasure,
int fitnessMeasure,
java.lang.String s)
prints information about this Partition |
void |
printInfo(Partition[] db,
int NPART,
double[] wTargetCondOnDB,
double[] wDBCondOnTarget,
double[] weight,
int entropyMeasure,
int fitnessMeasure,
java.lang.String s,
java.lang.StringBuffer output)
appends information about this Partition to output |
static void |
printIntersections(java.util.Hashtable[] intersectMap,
int nPart)
prints the intersection between classes of one partition and other nPart partitions |
void |
set(int rowid,
int c)
sets rowid to belong to class c ,
updates the class cardinality of the new and old class to whom
rowid belongs |
void |
set(Partition p)
sets the values of this Partition equal to the one from the parameter |
void |
setAM(java.util.Hashtable[] am)
sets this Partition according to the groupings in the array of Hashtables am that contains am.length
Hashtables |
void |
setClassCode(java.lang.String classOrig,
java.lang.Integer code)
sets an Integer encoding code for the class
classOrig |
void |
setClassFitness(int c,
double value)
sets the fitness of class c to value |
void |
setFitness(double f)
sets the fitness of this Partition to value f |
void |
setSize(int size)
resets the size of this partition to a smaller value size |
double |
sumDistSymDiff(Partition[] c,
int NPART)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int classFitnessType
protected int[] v
protected int size
protected int maxNoClasses
protected java.util.Hashtable classCard
protected java.util.Hashtable classCode
protected java.util.Hashtable classFitness
protected boolean cfIsValid
protected double fitness
public static final int CF_SYM_DIFF
public static final int CF_PROD
public static final int CF_DIV
public static final int CF_POW
Method Detail |
public void set(int rowid, int c)
rowid
to belong to class c
,
updates the class cardinality of the new and old class to whom
rowid belongs
public int get(int rowid)
rowid
public boolean hasClassCode(java.lang.String classOrig)
classOrig
has already a
numeric codepublic java.lang.Integer getClassCode(java.lang.String classOrig)
classOrig
public void setClassCode(java.lang.String classOrig, java.lang.Integer code)
code
for the class
classOrig
public int getMaxNoClasses()
public int getNoClasses()
public void printClassInfo()
public java.lang.String getClassesAndCardinalities()
public void printClassCardinalities()
public void printClassCardinalities(java.lang.StringBuffer output)
output
public void printClassFitness()
public int getSize()
public void setSize(int size)
size
public void init(java.util.Random rand)
rand
- random number generatorpublic void adjust(java.util.Random rand)
getMaxNoClasses()
classes
rand
- a random number generator objectpublic void getAM(java.util.Hashtable[] am)
am
, with the
array representation of the partition; in this array each class
corresponds to an index in the array; the contents of the array
at that index is a Hashtable with the rowids where the class
appears in the partition
public void setAM(java.util.Hashtable[] am)
am
that contains am.length
Hashtables
protected void print()
protected void print(java.lang.StringBuffer output)
output
public void printAM()
public double entropy(int entropyMeasure)
entropyMeasure
public boolean isEqual(Partition p)
public void set(Partition p)
public int getClassCard(int c)
c
public double getClassFitness(int c)
c
public void setClassFitness(int c, double value)
c
to value
public double getFitness()
public void setFitness(double f)
f
public int getClassFitnessType()
public static void computeIntersections(Partition[] c1, int NPART1, Partition[] c2, int NPART2, java.util.Hashtable[][] intersectMap)
c1
and classes of the partitions in
collection c2
NPART1
- represents the number of partitions in c1NPART2
- represents the number of partitions in c2intersectMap
- stores in intersectMap[i][j]: public static void computeIntersections(Partition p, Partition[] c, int NPART, java.util.Hashtable[] intersectMap)
p
and classes of the partitions in collection
c
NPART
- represents the number of partitions in cpublic static void printIntersections(java.util.Hashtable[] intersectMap, int nPart)
nPart
partitions
public double entropyIntersect(Partition p, int entropyMeasure)
entropyMeasure
public static void computeInfoIntersections(Partition[] c, int NPART, int entropyMeasure, java.util.Vector v)
v
with a Double representing the
value of the entropy of the partition determined by the
intersection of all NPART
partitions in the
collection c
and with an Integer representing the
number of classes of the intersection partition
public void computeFitness(java.util.Hashtable[] intersectMap, Partition[] c, int NPART, int entropyMeasure, int fitnessMeasure, double[] wTargetCondOnDB, double[] wDBCondOnTarget, double[] weight)
NPART
partitions in c
,
available in intersectMap
, according to the entropy
measure and distance measure
public void computeFitness(Partition[] c, int NPART, int entropyMeasure, int fitnessMeasure, double[] wTargetCondOnDB, double[] wDBCondOnTarget, double[] weight)
public static double estimateWeights(Partition[] db, int NPART, double sampleDBPct, int entropyMeasure, double[] wTargetCondOnDB, double[] wDBCondOnTarget, double[] weight, java.util.Random rand)
db
influences the target partition; the target
partition should be the last partition in db
;
sampleDBPct
specifies the percent of the database to
be sampled; sets wTargetCondonDB[i]
to
H(db[i]|db[target]) and sets the wDBCondOnTarget[i]
to H(db[target]|db[i]); sets weight[i]
to
wTargetCondOnDB[i]+wDBCondOnTarget[i]
public double distSymDiff(Partition c)
public double sumDistSymDiff(Partition[] c, int NPART)
public void computeSilhouettes(double[] silhouettes, int[] neighbors, Partition[] c, int NPART)
silhouettes
of dimension 'size'
with the silhoutte coefficients, computed with respect to the
classes in this Partition and with respect to the values of the
NPART
partitions in collection c
; this
Partition should have at least 2 classes; neighbors
will contain for each rowid the class number of the closest
class
public void plotSilhouettes(double[] silhouettes, int[] neighbors)
public void plotSilhouettes(double[] silhouettes, int[] neighbors, java.lang.StringBuffer output)
output
a graphical representation of the
silhouettes; classes are plotted in order and the elements in the
classes are plotted in decreasing order of their silhouette
public void printInfo(Partition[] db, int NPART, double[] wTargetCondOnDB, double[] wDBCondOnTarget, double[] weight, int entropyMeasure, int fitnessMeasure, java.lang.String s)
public void printInfo(Partition[] db, int NPART, double[] wTargetCondOnDB, double[] wDBCondOnTarget, double[] weight, int entropyMeasure, int fitnessMeasure, java.lang.String s, java.lang.StringBuffer output)
output
public java.util.ArrayList getClassIntersections(Partition target)
public double getClassifRate(Partition target)
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |