Class SMAggregateWeightedImpl
java.lang.Object
de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
de.uni_trier.wi2.procake.similarity.base.aggregate.impl.SMAggregateImpl
de.uni_trier.wi2.procake.similarity.base.aggregate.impl.SMAggregateWeightedImpl
- All Implemented Interfaces:
SMAggregate
,SMAggregateWeighted
,SimilarityMeasure
- Direct Known Subclasses:
SMAggregateAverageImpl
,SMAggregateKMaximumImpl
,SMAggregateKMinimumImpl
,SMAggregateMaximumImpl
,SMAggregateMinimumImpl
,SMAggregateMinkowskiImpl
public abstract class SMAggregateWeightedImpl
extends SMAggregateImpl
implements SMAggregateWeighted
- Author:
- rmaximi
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
LOG_ORDER_NAME_NOT_FOUND
Fields inherited from interface de.uni_trier.wi2.procake.similarity.base.aggregate.SMAggregate
DEFAULT_IGNORE_NULL_ATTRIBUTES_IN_QUERY, LOG_ATTRIBUTE_NAME_NOT_FOUND, LOG_ATTRIBUTE_NOT_FOUND, PROPERTY_USER_WEIGHT
Fields inherited from interface de.uni_trier.wi2.procake.similarity.base.aggregate.SMAggregateWeighted
DEFAULT_WEIGHT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getUserSimWeightsNormalized
(AggregateObject dataObject) double
protected void
Initialize measure based on existing instanceboolean
isEveryUserSimWeightZero
(Map<String, Double> weights) void
setDefaultWeight
(double defaultWeight) void
protected @Nullable SimilarityImpl
validateQueryNotEmpty
(DataObject queryObject, DataObject caseObject) Methods inherited from class de.uni_trier.wi2.procake.similarity.base.aggregate.impl.SMAggregateImpl
computeAttributeSimilarity, getSimilaritiesToUse, getSimilaritiesToUse, getSimilarityToUse, isIgnoreNullAttributesInQuery, isSimilarityFor, setIgnoreNullAttributesInQuery, setSimilarityToUse
Methods inherited from class de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
getDataClass, getName, initialize, isAggregate, isForceOverride, isInterval, isNumeric, isObject, isReusable, isSet, isTable, isTaxonomy, isText, setDataClass, setForceOverride, setName, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
compute, getDataClass, getName, getSystemName, isForceOverride, isReusable, setForceOverride
Methods inherited from interface de.uni_trier.wi2.procake.similarity.base.aggregate.SMAggregate
getSimilaritiesToUse, getSimilaritiesToUse, getSimilarityToUse, isIgnoreNullAttributesInQuery, setIgnoreNullAttributesInQuery, setSimilarityToUse
-
Field Details
-
k
protected int k
-
-
Constructor Details
-
SMAggregateWeightedImpl
public SMAggregateWeightedImpl()
-
-
Method Details
-
getWeight
- Specified by:
getWeight
in interfaceSMAggregateWeighted
- Returns:
- double the weight of the given attribute. If the weight is not set, the default weight 1.0 will be returned.
- Throws:
ProCAKENameNotFoundException
-
setWeight
- Specified by:
setWeight
in interfaceSMAggregateWeighted
- Parameters:
attributeName
- is the name of the attribute whos weight should be setweight
- is the weight of the attribute. The values will normalized automatically.- Throws:
ProCAKENameNotFoundException
- if the attribute not exists
-
getUserSimWeightsNormalized
-
isEveryUserSimWeightZero
-
getDefaultWeight
public double getDefaultWeight()- Specified by:
getDefaultWeight
in interfaceSMAggregateWeighted
- Returns:
- default weight
-
setDefaultWeight
public void setDefaultWeight(double defaultWeight) - Specified by:
setDefaultWeight
in interfaceSMAggregateWeighted
- Parameters:
defaultWeight
- is the default weight for each attribute, which hasn't an own weight
-
initializeBasedOn
Description copied from class:SimilarityMeasureImpl
Initialize measure based on existing instance- Overrides:
initializeBasedOn
in classSMAggregateImpl
- Parameters:
base
- similarity measure to base on
-
validateQueryNotEmpty
@Nullable protected @Nullable SimilarityImpl validateQueryNotEmpty(DataObject queryObject, DataObject caseObject) -
getAttributeWeights
- Specified by:
getAttributeWeights
in interfaceSMAggregateWeighted
- Returns:
- attribute weight map
-