libept
Public Member Functions | Protected Attributes | List of all members
ept::popcon::Local Class Reference

Access the results of the local daily popcon scan. More...

#include <local.h>

Public Member Functions

 Local (const std::string &file=std::string("/var/log/popularity-contest"))
time_t timestamp () const
 Get the timestamp of the local popcon information.
bool hasData () const
 Return true if this data source has data, false if it's empty.
float score (const std::string &pkg) const
 Return the local score of the package.
float tfidf (const Popcon &popcon, const std::string &pkg) const
 Return the TFIDF score of the package computed against the popcon information.
std::vector< std::pair
< std::string, float > > 
scores () const
 Read the local popcon vote and return the list of packages and their local scores, sorted by ascending score.
std::vector< std::pair
< std::string, float > > 
tfidf (const Popcon &popcon) const
 Read the local popcon vote and return the list of packages and their TFIDF scores computed against the popcon information.

Protected Attributes

std::map< std::string, float > m_scores
time_t m_timestamp

Detailed Description

Access the results of the local daily popcon scan.

Constructor & Destructor Documentation

ept::popcon::Local::Local ( const std::string &  file = std::string("/var/log/popularity-contest"))

References ept::axi::timestamp().

Member Function Documentation

bool ept::popcon::Local::hasData ( ) const
inline

Return true if this data source has data, false if it's empty.

References m_timestamp.

float ept::popcon::Local::score ( const std::string &  pkg) const

Return the local score of the package.

std::vector< std::pair< std::string, float > > ept::popcon::Local::scores ( ) const

Read the local popcon vote and return the list of packages and their local scores, sorted by ascending score.

float ept::popcon::Local::tfidf ( const Popcon popcon,
const std::string &  pkg 
) const

Return the TFIDF score of the package computed against the popcon information.

The TFIDF score is high when a package is representative of this system, that is, it is used in this system and not much used in other systems.

References ept::popcon::Popcon::score(), and ept::popcon::Popcon::submissions().

std::vector< std::pair< std::string, float > > ept::popcon::Local::tfidf ( const Popcon popcon) const

Read the local popcon vote and return the list of packages and their TFIDF scores computed against the popcon information.

The packages will be sorted by ascending score.

References ept::popcon::Popcon::score(), and ept::popcon::Popcon::submissions().

time_t ept::popcon::Local::timestamp ( ) const
inline

Get the timestamp of the local popcon information.

References m_timestamp.

Member Data Documentation

std::map<std::string, float> ept::popcon::Local::m_scores
protected
time_t ept::popcon::Local::m_timestamp
protected

Referenced by hasData(), and timestamp().


The documentation for this class was generated from the following files: