Esempio n. 1
0
    def create_pkg_data(self):
        user = LocalSystem()
        user.maximal_pkg_profile()
        user.no_auto_pkg_profile()
        user_pkgs = user.pkg_profile

        pkgs_time = self.get_packages_time(user_pkgs)
        self.save_package_time(pkgs_time)
        return pkgs_time
Esempio n. 2
0
    def get_user(self, no_auto_pkg_profile):
        config = Config()

        user = LocalSystem()
        user.filter_pkg_profile(os.path.join(config.filters_dir,
                                             "desktopapps"))
        user.maximal_pkg_profile()

        if no_auto_pkg_profile:
            user.no_auto_pkg_profile()

        return user
Esempio n. 3
0
    def get_user(self, no_auto_pkg_profile):
        config = Config()

        user = LocalSystem()
        user.filter_pkg_profile(
            os.path.join(config.filters_dir, "desktopapps"))
        user.maximal_pkg_profile()

        if no_auto_pkg_profile:
            user.no_auto_pkg_profile()

        return user
Esempio n. 4
0
sys.path.insert(0, '../')
import logging
import datetime

from apprecommender.config import Config
from apprecommender.recommender import Recommender
from apprecommender.user import LocalSystem
from apprecommender.error import Error

if __name__ == '__main__':
    try:
        cfg = Config()
        rec = Recommender(cfg)
        user = LocalSystem()
        user.no_auto_pkg_profile()
        # user.maximal_pkg_profile()

        begin_time = datetime.datetime.now()
        logging.debug("Recommendation computation started at %s" % begin_time)

        print rec.get_recommendation(user)

        end_time = datetime.datetime.now()
        logging.debug("Recommendation computation completed at %s" % end_time)
        delta = end_time - begin_time
        logging.info("Time elapsed: %d seconds." % delta.seconds)

    except Error:
        logging.critical("Aborting proccess. Use '--debug' for more details.")
Esempio n. 5
0
from apprecommender.config import Config
from apprecommender.evaluation import (Precision, Recall, F1, Accuracy,
                                       SimpleAccuracy, CrossValidation)
from apprecommender.recommender import Recommender
from apprecommender.user import LocalSystem
from apprecommender.error import Error

if __name__ == '__main__':
    try:
        cfg = Config()
        rec = Recommender(cfg)
        print "\nRecommender strategy: ", rec.strategy.description
        user = LocalSystem()
        # user.app_pkg_profile(rec.items_repository)
        user.no_auto_pkg_profile()
        begin_time = datetime.datetime.now()
        logging.debug("Cross-validation started at %s" % begin_time)

        metrics = []
        metrics.append(Precision())
        metrics.append(Recall())
        metrics.append(F1())
        metrics.append(Accuracy())
        metrics.append(SimpleAccuracy())
        validation = CrossValidation(0.9, 10, rec, metrics, 0.1)
        validation.run(user)
        print validation

        end_time = datetime.datetime.now()
        logging.debug("Cross-validation completed at %s" % end_time)