#include <CQInvertedFile.h>
Public Member Functions | |
void | finishInit () |
finish the initialisation phase make the weighting function know who its normalizers are | |
CQInvertedFile (CAccessorAdminCollection &inAccessorAdminCollection, CAlgorithm &inAlgorithm) | |
New constructor, taking as parameter the algorithm structure, which contains all the algorithm configuration. | |
~CQInvertedFile () | |
destructor | |
virtual bool | setAlgorithm (CAlgorithm &inAlgorithm) |
set the Algorithm. | |
virtual CIDRelevanceLevelPairList * | fastQuery (const CXMLElement &inQuery, int inNumberOfInterestingImages, double inDifferenceToBest) |
a query which returns ID/RelevanceLevel pairs instead of instead of URL/RelevanceLevel pairs; this is faster for merging tasks (to explain the name) queries for URLs are answered by query (in herited) | |
virtual CIDRelevanceLevelPairList * | fastQueryByFeature (const CWeightingFunctionPointerList &inQuery, int inNumberOfInterestingImages, double inDifferenceToBest) |
Assuming that a correct CWeightingFunctionPointerHash has been built by fastQuery (or another function), this function will do the rest. | |
double | DIDToScore (TID inDID, const CWeightingFunctionPointerHash &inQuery) const |
Returns the score for one image in the query. | |
double | URLToScore (const string &inURL, const CWeightingFunctionPointerHash &inQuery) const |
Returns the score for one image in the query. | |
double | FeatureListToScore (TID inDID, const CDocumentFrequencyList &inFeatureList, const CWeightingFunctionPointerHash &inQuery) const |
Turns the featurelist of a document into a score. | |
void | buildNormalizedQueryHash (const CRelevanceLevel &inQuery, CWeightingFunctionPointerHash &outQueryFeatureWeighters) const |
void | activateBlockingFeatures () |
activateBlockingFeatures - sets the variable to block groups of features | |
void | releaseBlockingFeatures () |
releaseBlockingFeatures - this turns off the blocking of features | |
bool | featuresBlocked () const |
featuresBlocked - returns true if the features are blocked | |
void | blockFeatureGroup (const int featureNumber) |
blockFeatureGroup - this blocks one special group of features | |
void | unblockFeatureGroup (const int featureNumber) |
unblockFeatureGroup - this releases the blocking of one feature group | |
bool | isBlocked (const int featureNumber) const |
isBlocked - returns true if the feature is blocked and false if not | |
void | releaseAllPrunings () |
sets back all the variables for the pruning | |
void | useFeaturePruning (double percentage) |
activates the feature pruning with evaluating a certain percentage of the features | |
void | releaseFeaturePruning () |
set the variables back to its normal status | |
void | useTimePruning (double inTimeCutoffPoint) |
activates the time pruning with the give cuOffPoint | |
void | releaseTimePruning () |
releases the timePruning | |
void | useScoreBoardPruning (double inCutAfterFraction, double inReduceToFactor) |
creates one entry in the scoreboardPruning | |
void | releaseScoreBoardPruning () |
releases all the settings for the ScorboardPruning | |
void | useEvaluateAfterPruning () |
activates the evaluation after the scoreboardPruning | |
void | releaseEvaluateAfterPruning () |
releases the evaluation after the scoreboard pruning | |
CWeighter & | getWeighter () |
For FerDeLance queries. | |
Public Attributes | |
bool | mBlockingOn |
bool | mBlockingArray [MAXIMUMNUMBEROFEATUREGROUPS] |
bool | mPruningUsed |
Shows if any pruning is used. | |
bool | mScoreBoardPruningUsed |
true if the scoreboardis Pruned | |
parameterPruningType | mScoreBoardPruningArray [MAX_SCOREBOARD_PRUNINGS] |
Henning Müller | |
int | mNumberofUsedScoreBoardPrunings |
Henning Müller | |
bool | mFeaturePruningUsed |
double | mPercentageofFeatures |
Henning Müller | |
bool | mTimePruningUsed |
double | mStoppingTime |
Henning Müller | |
bool | mEvaluateAfterPruning |
Static Public Attributes | |
static const int | MAXIMUMNUMBEROFEATUREGROUPS = 50 |
static const int | MAX_SCOREBOARD_PRUNINGS = 10 |
These are the variables and functions used for the pruning process. | |
Protected Member Functions | |
double | keepScore (CScoreBoard &inoutScoreBoard, const CWeightingFunctionPointerList &inFeatures, bool lPositive) const |
calculates the score for all the images based on a list of features | |
double | keepScorePruning (CScoreBoard &inoutScoreBoard, const CWeightingFunctionPointerList &inFeatures, bool inPositive, int inDesiredNumberOfDocuments) const |
calculates the results for the images using some sort of pruning | |
void | buildQueryHash (CRelevanceLevelList &inQuery, CWeightingFunctionPointerHash &outQueryFeatureWeighters) const |
creates a list of all the features which are in one or more of the query images should be replaced by a version which operates on IDs not URLs | |
void | buildNormalizedQueryList (double inPositiveRelevanceSum, double inNegativeRelevanceSum, CWeightingFunctionPointerHash &inQFW, CWeightingFunctionPointerList &outQFW) const |
Building a list of normalized WF from a hash of Weighting functions. | |
void | buildNormalizedQueryHash (double inPositiveRelevanceSum, double inNegativeRelevanceSum, CWeightingFunctionPointerHash &inQFW) const |
Building a list of normalized WF from a hash of Weighting functions. | |
void | init () |
Initializer, used by both construcors. | |
Protected Attributes | |
CAlgorithm * | mDeb |
int | mModulo |
You can choose to use only every lModulo-th feature. | |
int | mModuloClass |
Every lModulo-th feature, starting at lModuloClass. | |
CWeighterFactory | mWeighterFactory |
This is a factory for weighters. | |
CSelfDestroyPointer< CWeighter > | mWeighter |
The weighter currently used. | |
CSelfDestroyPointer < CWeightingFunctionPointerHash > | mQueryFeatureWeighters |
object of this type to have a list of the features with the weights | |
Classes | |
struct | parameterPruningType |
Parameters for scoreboard pruning. More... |
CQInvertedFile::CQInvertedFile | ( | CAccessorAdminCollection & | inAccessorAdminCollection, | |
CAlgorithm & | inAlgorithm | |||
) |
New constructor, taking as parameter the algorithm structure, which contains all the algorithm configuration.
CQInvertedFile::~CQInvertedFile | ( | ) |
destructor
double CQInvertedFile::keepScore | ( | CScoreBoard & | inoutScoreBoard, | |
const CWeightingFunctionPointerList & | inFeatures, | |||
bool | lPositive | |||
) | const [protected] |
calculates the score for all the images based on a list of features
double CQInvertedFile::keepScorePruning | ( | CScoreBoard & | inoutScoreBoard, | |
const CWeightingFunctionPointerList & | inFeatures, | |||
bool | inPositive, | |||
int | inDesiredNumberOfDocuments | |||
) | const [protected] |
calculates the results for the images using some sort of pruning
void CQInvertedFile::buildQueryHash | ( | CRelevanceLevelList & | inQuery, | |
CWeightingFunctionPointerHash & | outQueryFeatureWeighters | |||
) | const [protected] |
creates a list of all the features which are in one or more of the query images should be replaced by a version which operates on IDs not URLs
void CQInvertedFile::buildNormalizedQueryList | ( | double | inPositiveRelevanceSum, | |
double | inNegativeRelevanceSum, | |||
CWeightingFunctionPointerHash & | inQFW, | |||
CWeightingFunctionPointerList & | outQFW | |||
) | const [protected] |
Building a list of normalized WF from a hash of Weighting functions.
void CQInvertedFile::buildNormalizedQueryHash | ( | double | inPositiveRelevanceSum, | |
double | inNegativeRelevanceSum, | |||
CWeightingFunctionPointerHash & | inQFW | |||
) | const [protected] |
Building a list of normalized WF from a hash of Weighting functions.
void CQInvertedFile::init | ( | ) | [protected, virtual] |
virtual bool CQInvertedFile::setAlgorithm | ( | CAlgorithm & | inAlgorithm | ) | [virtual] |
virtual CIDRelevanceLevelPairList* CQInvertedFile::fastQuery | ( | const CXMLElement & | inQuery, | |
int | inNumberOfInterestingImages, | |||
double | inDifferenceToBest | |||
) | [virtual] |
a query which returns ID/RelevanceLevel pairs instead of instead of URL/RelevanceLevel pairs; this is faster for merging tasks (to explain the name) queries for URLs are answered by query (in herited)
Implements CQuery.
virtual CIDRelevanceLevelPairList* CQInvertedFile::fastQueryByFeature | ( | const CWeightingFunctionPointerList & | inQuery, | |
int | inNumberOfInterestingImages, | |||
double | inDifferenceToBest | |||
) | [virtual] |
Assuming that a correct CWeightingFunctionPointerHash has been built by fastQuery (or another function), this function will do the rest.
double CQInvertedFile::DIDToScore | ( | TID | inDID, | |
const CWeightingFunctionPointerHash & | inQuery | |||
) | const |
Returns the score for one image in the query.
double CQInvertedFile::URLToScore | ( | const string & | inURL, | |
const CWeightingFunctionPointerHash & | inQuery | |||
) | const |
Returns the score for one image in the query.
void CQInvertedFile::activateBlockingFeatures | ( | ) |
activateBlockingFeatures - sets the variable to block groups of features
void CQInvertedFile::releaseBlockingFeatures | ( | ) |
releaseBlockingFeatures - this turns off the blocking of features
bool CQInvertedFile::featuresBlocked | ( | ) | const |
featuresBlocked - returns true if the features are blocked
void CQInvertedFile::blockFeatureGroup | ( | const int | featureNumber | ) |
blockFeatureGroup - this blocks one special group of features
void CQInvertedFile::unblockFeatureGroup | ( | const int | featureNumber | ) |
unblockFeatureGroup - this releases the blocking of one feature group
bool CQInvertedFile::isBlocked | ( | const int | featureNumber | ) | const |
isBlocked - returns true if the feature is blocked and false if not
void CQInvertedFile::releaseAllPrunings | ( | ) |
sets back all the variables for the pruning
Henning Müller
void CQInvertedFile::useFeaturePruning | ( | double | percentage | ) |
activates the feature pruning with evaluating a certain percentage of the features
Henning Müller
void CQInvertedFile::releaseFeaturePruning | ( | ) |
set the variables back to its normal status
Henning Müller
void CQInvertedFile::useTimePruning | ( | double | inTimeCutoffPoint | ) |
activates the time pruning with the give cuOffPoint
Henning Müller
void CQInvertedFile::releaseTimePruning | ( | ) |
releases the timePruning
Henning Müller
void CQInvertedFile::useScoreBoardPruning | ( | double | inCutAfterFraction, | |
double | inReduceToFactor | |||
) |
creates one entry in the scoreboardPruning
Henning Müller
void CQInvertedFile::releaseScoreBoardPruning | ( | ) |
releases all the settings for the ScorboardPruning
Henning Müller
void CQInvertedFile::useEvaluateAfterPruning | ( | ) |
activates the evaluation after the scoreboardPruning
Henning Müller
void CQInvertedFile::releaseEvaluateAfterPruning | ( | ) |
releases the evaluation after the scoreboard pruning
Henning Müller
CWeighterFactory CQInvertedFile::mWeighterFactory [protected] |
This is a factory for weighters.
With this we can find the weighters
const int CQInvertedFile::MAX_SCOREBOARD_PRUNINGS = 10 [static] |
These are the variables and functions used for the pruning process.
the maximum number of sets which can be used to prune the ScoreBoard