42 #ifndef _CWEIGHTINGFUNCTION 43 #define _CWEIGHTINGFUNCTION 44 #include "libGIFTQuInvertedFile/include/uses-declarations.h" 46 #include "libMRML/include/TID.h" 47 #include "libGIFTAcInvertedFile/include/CDocumentFrequencyElement.h" 48 #include "libGIFTAcInvertedFile/include/CAcInvertedFile.h" 98 double mPositiveTermFrequency;
104 double mNegativeTermFrequency;
134 double mDocumentFactor;
205 double inNegativeRelevanceSum);
229 virtual double subApply(
const double inDocumentFrequency,
230 const double inNormalizingFactor)
const;
280 public binary_function
281 <CWeightingFunction,CWeightingFunction,bool>{
296 public binary_function
297 <CWeightingFunction,CWeightingFunction,bool>{
318 public binary_function
319 <CWeightingFunction,CWeightingFunction,bool>{
337 public binary_function
338 <CWeightingFunction,CWeightingFunction,bool>{
355 template<
class CSortOp>
357 binary_function<CWeightingFunction*,CWeightingFunction*,bool>{
367 return mSorter(*l,*t);
371 #include "libGIFTQuInvertedFile/include/CQueryNormalizer.h" virtual CWeightingFunction * constructNew(TID inID) const
For the "prototype pattern": Kinda virtual copy constructor: Gamma/Helm/Johnson/Vlissides p...
double mPositiveRelevanceSum
This value depends on all the elements of the query, which have a positive user-assigned relevance...
Definition: CWeightingFunction.h:81
virtual ~CWeightingFunction()
This virtual destructor is here inorder to call the (inherited) default constructors.
virtual double getTermFrequency() const
Giving a pseudo term frequency for normalization.
CWeightingFunction: Sort by FeatureID.
Definition: CWeightingFunction.h:279
virtual CWeightingFunction * clone() const
For the "prototype pattern": Kinda virtual copy constructor: Gamma/Helm/Johnson/Vlissides p...
CWeightingFunction(const CAcInvertedFile *inAccessor=0, CQueryNormalizer *inQueryNormalizer=0, CQueryNormalizer *inThisNormalizer=0)
Constructor:
double mNegativeRelevanceSum
This value depends on all the elements of the query, which have a negative user-assigned relevance...
Definition: CWeightingFunction.h:91
double mQueryFactor
The query usually will separate into a part which is equal for all the query and a part which is to b...
Definition: CWeightingFunction.h:132
For normalizing weights like in Salton/Buckley we need to now all the features in the query or all th...
Definition: CQueryNormalizer.h:55
TID getID() const
get the ID of this feature
CWeightingFunction: Sort by DocumentFrequency/CollectionFrequency.
Definition: CWeightingFunction.h:317
a universally usable class for weighting.
Definition: CWeightingFunction.h:70
const CAcInvertedFile * mAccessor
The accessor for the file on which the query is performed.
Definition: CWeightingFunction.h:117
CQueryNormalizer * mQueryNormalizer
FIXME THERE IS A GOOD DESCRIPTION MISSING FOR THE NEXT TWO VARIABLES.
Definition: CWeightingFunction.h:121
void setAccessor(const CAcInvertedFile *)
Set the accessor (should not be needed)
double applyOnThis() const
Preparing the right parameters for subApply: Apply this on itself.
An accessor to an inverted file.
Definition: CAcInvertedFile.h:83
virtual double apply(const CDocumentFrequencyElement &inResultFeature) const
Preparing the right parameters for subApply: Apply this on another feature.
CWeightingFunction: Sort by DocumentFrequency/CollectionFrequency.
Definition: CWeightingFunction.h:295
virtual double FeatureToCollectionFrequency(TFeatureID) const =0
Collection frequency for a given feature.
virtual void addQueryFeature(double inRelevanceLevel, const CDocumentFrequencyElement &inQueryFeature)
Add a feature.
CDOCUMENTFREQUENCYELEMENT.
Definition: CDocumentFrequencyElement.h:49
int mFeatureDescription
At present the feature description is a simple integer which expresses if the feature is a histogram ...
Definition: CWeightingFunction.h:111
double getQueryFactor() const
The query factor contains all informatio which depends only on the query.
void setNormalizers(CQueryNormalizer *inQueryNormalizer, CQueryNormalizer *inThisNormalizer)
Set the query normalizer (should not be needed);.
CWeightingFunction: Sort by the absolute value of the query factor.
Definition: CWeightingFunction.h:336
virtual double subApply(const double inDocumentFrequency, const double inNormalizingFactor) const
Apply this on a document frequency.
CQueryNormalizer * mThisNormalizer
A normalizer for apply on self.
Definition: CWeightingFunction.h:125
void setID(TID)
Set the ID of this feature.
virtual void preCalculate()
Calculate the QueryFactor.
Definition: CWeightingFunction.h:356
void setRelevanceSum(double inPositiveRelevanceSum, double inNegativeRelevanceSum)
Setting the relevance sum, that is the sum of the absolute values of all relevance levels of all docu...