|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.kpro.algorithm.DistanceMetric
com.kpro.algorithm.bitmapDistance
public class bitmapDistance
A distance metric that calculates distance based on weighed union of a bit map interception
Field Summary | |
---|---|
private double |
admin
|
private double |
business_practices
|
private double |
contact
|
private double |
current
|
private double |
delivery
|
private double |
develop
|
private double |
historical
|
private double |
indefinitely
|
private double |
individual_analysis
|
private double |
individual_decision
|
private double |
legal_requirement
|
private double |
no_retention
|
private double |
other_purpose
|
private double |
other_recipient
|
private double |
ours
|
private double |
pseudo_analysis
|
private double |
pseudo_decision
|
private double |
pub
|
private double |
same
|
private double |
stated_purpose
|
private double |
tailoring
|
private double |
telemarketing
|
private double |
unrelated
|
Fields inherited from class com.kpro.algorithm.DistanceMetric |
---|
extraArgs, weightsConfig |
Constructor Summary | |
---|---|
bitmapDistance(java.util.Properties weights,
java.lang.String[] extraArgs)
|
Method Summary | |
---|---|
private double |
getDistance(PolicyObject a,
PolicyObject b,
int time)
the method for distance between PolicyObjects it runs twice in a recursive paten, 1st a/b then b/a |
private double |
getDistData(Case a,
Case b)
Calculates distance in Data-string from case a to case b using string comparison and multiplies with a STATIC number if 1st strings are not equal |
private double |
getDistPurpose(Case a,
Case b)
Calculates distance in the Purpose field from case a to case b using bit map distance = a interseption b * weight |
private double |
getDistRecip(Case a,
Case b)
Calculates distance in the Recipien field from case a to case b using bit map distance = a interseption b * weight |
private double |
getDistReten(Case a,
Case b)
Calculates distance in the Retention field from case a to case b using bit map distance = a interseption b * weight |
private double |
getSumDistance(Case a,
Case b)
Returns sum of distances of all fields between case a and b |
double |
getTotalDistance(PolicyObject a,
PolicyObject b)
Initializes weights and returns the distance between two PolicyObjects. |
private double[] |
MakePurposeMap(java.util.ArrayList<Purpose> list)
internal method that makes a bit map of 12 doubles each place in an array corresponds to a spesfic value of a Purpose Enum |
private double[] |
MakeRecipMap(java.util.ArrayList<Recipient> list)
internal method that makes a bit map of 6 ints each place in an array corresponds to a spesfic value of a Recipient field |
private double[] |
MakeRetentionMap(java.util.ArrayList<Retention> list)
internal method that makes a bit map of 5 ints each place in an array corresponds to a spesfic value of a Retention Enum |
private void |
setWeights()
Loads weight to speed upp run time |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private double ours
private double delivery
private double same
private double other_recipient
private double unrelated
private double pub
private double current
private double admin
private double develop
private double tailoring
private double pseudo_analysis
private double pseudo_decision
private double individual_analysis
private double individual_decision
private double contact
private double historical
private double telemarketing
private double other_purpose
private double no_retention
private double stated_purpose
private double legal_requirement
private double business_practices
private double indefinitely
Constructor Detail |
---|
public bitmapDistance(java.util.Properties weights, java.lang.String[] extraArgs)
Method Detail |
---|
private void setWeights()
private double[] MakeRecipMap(java.util.ArrayList<Recipient> list)
list
- input arraylist of ReciPients for method...
private double[] MakePurposeMap(java.util.ArrayList<Purpose> list)
list
- input arraylist of Purpose for method...
private double[] MakeRetentionMap(java.util.ArrayList<Retention> list)
list
- input arraylist of Purpose for method...
private double getDistRecip(Case a, Case b)
a
- input case.b
- input case.
private double getDistReten(Case a, Case b)
a
- input case.b
- input case.
private double getDistData(Case a, Case b)
a
- input case.b
- input case.
private double getDistPurpose(Case a, Case b)
a
- input case.b
- input case.
private double getSumDistance(Case a, Case b)
a
- Caseb
- Case
private double getDistance(PolicyObject a, PolicyObject b, int time)
a
- PolicyObjectb
- PolicyObjecttime
-
public double getTotalDistance(PolicyObject a, PolicyObject b)
getTotalDistance
in class DistanceMetric
a
- the 1st policy objectb
- the second policy object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |