public class ProfileConcept extends java.lang.Object implements java.lang.Comparable<ProfileConcept>
Constructor and Description |
---|
ProfileConcept()
Null constructor.
|
ProfileConcept(java.util.ArrayList<java.lang.String> concepts,
int freq,
long lastTimestamp,
boolean positive,
double avgDegree)
Instantiates a new profile concept.
|
ProfileConcept(java.util.ArrayList<java.lang.String> concepts,
int freq,
long lastTimestamp,
boolean positive,
double aggregatedweight,
java.util.ArrayList<java.lang.String> context)
Instantiates a new profile concept.
|
ProfileConcept(ProfileConcept c)
Constructs a
ProfileConcept object by an existing
ProfileConcept . |
ProfileConcept(java.lang.String serialized)
Constructs a
ProfileConcept from a String. |
ProfileConcept(java.lang.String concept,
int freq,
long lastTimestamp,
boolean positive,
double aggregatedweight,
java.util.ArrayList<java.lang.String> context)
Instantiates a new profile concept.
|
ProfileConcept(java.lang.String concept,
int freq,
long lastTimestamp,
boolean positive,
double aggregatedweight,
java.util.ArrayList<java.lang.String> context,
java.lang.Double gainInterest)
Constructs a profile concept.
|
ProfileConcept(java.lang.String concept,
java.lang.String instance,
int freq,
long lastTimestamp,
boolean positive,
double aggregatedweight,
java.util.ArrayList<java.lang.String> context)
Instantiates a new profile concept.
|
Modifier and Type | Method and Description |
---|---|
void |
addConcept(java.lang.String concept)
Adds an ontology concept.
|
int |
compareTo(ProfileConcept otherPConcept)
Compares the weight of two
ProfileConcept objects. |
boolean |
equals(java.lang.Object obj)
Compares two
ProfileConcept objects. |
java.lang.String |
getConcept()
Gets the concept.
|
java.util.ArrayList<java.lang.String> |
getConcepts()
Gets the ontology concepts in the
ProfileConcept . |
java.util.ArrayList<java.lang.String> |
getConceptsInRule(ProfileConcept complexConcept)
Gets the concepts in rule.
|
double |
getCurrentNormalisedWeight(int transactionsNumber)
Calculates and returns the current weight of the
ProfileConcept with the use of a normaliser that represents
the weight in the [0,1] interval. |
double |
getCurrentNormalisedWeightLamdaVersion(int transactionsNumber,
double lamda)
Gets the current normalised weight lamda version.
|
double |
getCurrentNormalisedWeightNewVersion(int transactionsNumber)
Gets the current normalised weight new version.
|
int |
getFreq()
Gets the frequency.
|
double |
getGainInterest()
Gets the gain interest.
|
java.lang.String |
getInstance()
Gets the single instance of ProfileConcept.
|
long |
getLastTimestamp()
Gets the last timestamp.
|
double |
getNormalisedWeight()
Returns the saved weight of the
ProfileConcept with the use
of a normaliser that represents the weight in the [0,1] interval. |
double |
getWeight()
Returns the saved weight of the
ProfileConcept . |
int |
hashCode() |
boolean |
isPositive()
Checks if the profile concept is positive.
|
static java.util.ArrayList<ProfileConcept> |
readFromFile(java.lang.String filename)
Utility method that reads profile concepts from a file.
|
static double |
roundDouble(double targetDBL)
Rounds a double number into
decimalPlace precision. |
void |
setConcept(java.lang.String c)
Sets the concept.
|
void |
setConcepts(java.util.ArrayList<java.lang.String> concepts)
Sets the ontology concepts for the
ProfileConcept . |
void |
setFreq(int freq)
Sets the frequency.
|
void |
setInstance(java.lang.String i)
Sets the instance.
|
void |
setLastTimestamp(long lastTimestamp)
Sets the last timestamp.
|
void |
setPositive(boolean positive)
Sets the boolean that describes whether the profile concept is positive
or not.
|
void |
setWeight(double w)
Sets the profile concept's weight.
|
void |
setWeight(java.lang.Double weight)
Sets the weight.
|
java.lang.String |
toString()
Returns a String representation of the
ProfileConcept . |
java.lang.String |
toStringProfileFormat()
Returns a String representation of a
ProfileConcept in the
format that the profile concepts are presented in the Profile tab
of the web interface. |
static void |
writeToFile(java.util.ArrayList<ProfileConcept> concepts,
java.lang.String filename)
Utility method that writes profile concepts to a file.
|
static void |
writeToFileProfileFormat(java.util.ArrayList<ProfileConcept> concepts,
java.lang.String filename)
Utility method that writes profile concepts to a file, in the format that
the profile concepts are presented in the Profile tab of the web
interface.
|
public ProfileConcept()
public ProfileConcept(java.lang.String concept, int freq, long lastTimestamp, boolean positive, double aggregatedweight, java.util.ArrayList<java.lang.String> context, java.lang.Double gainInterest)
concept
- the conceptfreq
- the frequencylastTimestamp
- the last timestamppositive
- the boolean stating whether this profile concept is positive
or negativeaggregatedweight
- the aggregatedweightcontext
- the contextgainInterest
- the gain interestpublic ProfileConcept(java.util.ArrayList<java.lang.String> concepts, int freq, long lastTimestamp, boolean positive, double avgDegree)
concepts
- the conceptsfreq
- the freqlastTimestamp
- the last timestamppositive
- the positiveavgDegree
- the avg degreepublic ProfileConcept(java.util.ArrayList<java.lang.String> concepts, int freq, long lastTimestamp, boolean positive, double aggregatedweight, java.util.ArrayList<java.lang.String> context)
concepts
- the conceptsfreq
- the freqlastTimestamp
- the last timestamppositive
- the positiveaggregatedweight
- the aggregatedweightcontext
- the contextpublic ProfileConcept(java.lang.String concept, int freq, long lastTimestamp, boolean positive, double aggregatedweight, java.util.ArrayList<java.lang.String> context)
concept
- the conceptfreq
- the freqlastTimestamp
- the last timestamppositive
- the positiveaggregatedweight
- the aggregatedweightcontext
- the contextpublic ProfileConcept(java.lang.String concept, java.lang.String instance, int freq, long lastTimestamp, boolean positive, double aggregatedweight, java.util.ArrayList<java.lang.String> context)
concept
- the conceptinstance
- the instancefreq
- the freqlastTimestamp
- the last timestamppositive
- the positiveaggregatedweight
- the aggregatedweightcontext
- the contextpublic ProfileConcept(ProfileConcept c)
ProfileConcept
object by an existing
ProfileConcept
.c
- the existing ProfileConcept
.public ProfileConcept(java.lang.String serialized)
ProfileConcept
from a String.serialized
- the serializedpublic java.lang.String getConcept()
public void setConcept(java.lang.String c)
c
- the new conceptpublic void setInstance(java.lang.String i)
i
- the new instancepublic java.lang.String getInstance()
public double getGainInterest()
public java.lang.String toString()
ProfileConcept
.toString
in class java.lang.Object
ProfileConcept
public java.lang.String toStringProfileFormat()
ProfileConcept
in the
format that the profile concepts are presented in the Profile tab
of the web interface.ProfileConcept
public java.util.ArrayList<java.lang.String> getConcepts()
ProfileConcept
.public java.util.ArrayList<java.lang.String> getConceptsInRule(ProfileConcept complexConcept)
complexConcept
- the complex conceptpublic void setConcepts(java.util.ArrayList<java.lang.String> concepts)
ProfileConcept
.concepts
- the new ontology conceptspublic void addConcept(java.lang.String concept)
concept
- the ontology conceptpublic double getWeight()
ProfileConcept
.ProfileConcept
.public double getNormalisedWeight()
ProfileConcept
with the use
of a normaliser that represents the weight in the [0,1] interval.public double getCurrentNormalisedWeight(int transactionsNumber)
ProfileConcept
with the use of a normaliser that represents
the weight in the [0,1] interval.transactionsNumber
- the transactions numberpublic double getCurrentNormalisedWeightNewVersion(int transactionsNumber)
transactionsNumber
- the transactions numberpublic double getCurrentNormalisedWeightLamdaVersion(int transactionsNumber, double lamda)
transactionsNumber
- the transactions numberlamda
- the lamdapublic void setWeight(double w)
w
- the new weightpublic boolean isPositive()
public void setPositive(boolean positive)
positive
- the new positivepublic long getLastTimestamp()
public void setLastTimestamp(long lastTimestamp)
lastTimestamp
- the new timestamppublic int getFreq()
public void setFreq(int freq)
freq
- the new frequencypublic boolean equals(java.lang.Object obj)
ProfileConcept
objects.equals
in class java.lang.Object
obj
- the object to compareProfileConcept
.public int hashCode()
hashCode
in class java.lang.Object
public static java.util.ArrayList<ProfileConcept> readFromFile(java.lang.String filename)
filename
- : the path to the file that contains the concepts.public static void writeToFile(java.util.ArrayList<ProfileConcept> concepts, java.lang.String filename)
concepts
- the concepts to be written to the file.filename
- the path to the file that the concepts will be written.public static void writeToFileProfileFormat(java.util.ArrayList<ProfileConcept> concepts, java.lang.String filename)
concepts
- : The concepts to be written to the file.filename
- : the path to the file that the concepts will be written.public static double roundDouble(double targetDBL)
decimalPlace
precision.targetDBL
- the double number to round.public int compareTo(ProfileConcept otherPConcept)
ProfileConcept
objects.compareTo
in interface java.lang.Comparable<ProfileConcept>
otherPConcept
- the other concept to compareProfileConcept
is greater than the last timestamp of the latter. Else 0.public void setWeight(java.lang.Double weight)
weight
- the new weight