Skip to content

Latest commit

 

History

History
1157 lines (770 loc) · 23.1 KB

alpenglow.cpp.rst

File metadata and controls

1157 lines (770 loc) · 23.1 KB

alpenglow.cpp package

The classes in this module are usually not used directly, but instead through the :pyalpenglow.Getter class. For more info, read

  • /general/implement_your_model
  • /general/cpp_api
  • /general/simulation_attributes
  • /general/python_api

Note that there are some C++ classes that have no python interface. These are not documented here.

Filters

The function of the filter interface is limiting the available set of items. Current filters are whitelist-type filters, implementing :pyalpenglow.cpp.WhitelistFilter.

To use a filter in an experiment, wrap the model into the filter using :pyalpenglow.cpp.WhitelistFilter2ModelAdapter.

Example:

class LabelExperiment(prs.OnlineExperiment):
    '''Sample experiment illustrating the usage of LabelFilter. The
    experiment contains a PopularityModel and a LabelFilter.'''
    def _config(self, top_k, seed):
        model = ag.PopularityModel()
        updater = ag.PopularityModelUpdater()
        updater.set_model(model)
        label_filter = ag.LabelFilter(**self.parameter_defaults(
            label_file_name = ""
        ))
        adapter = ag.WhitelistFilter2ModelAdapter()
        adapter.set_model(model)
        adapter.set_whitelist_filter(label_filter)

alpenglow.cpp.WhitelistFilter

alpenglow.cpp.WhitelistFilter2ModelAdapter

alpenglow.cpp.LabelFilterParameters

alpenglow.cpp.LabelFilter

alpenglow.cpp.AvailabilityFilter

Offline evaluators

Use offline evaluators in traditional, fixed train/test split style learning. Check the code of :pyalpenglow.offline.OfflineModel.OfflineModel descendants for usage examples.

alpenglow.cpp.PrecisionRecallEvaluatorParameters

alpenglow.cpp.PrecisionRecallEvaluator

alpenglow.cpp.OfflineRankingComputerParameters

alpenglow.cpp.OfflinePredictions

alpenglow.cpp.OfflineRankingComputer

alpenglow.cpp.OfflineEvaluator

Recommender data

This module contains the classes that are responsible for reading in the dataset and serving it to other classes of the experiment.

Interface :pyalpenglow.cpp.RecommenderData is the anchestor for classes that read in the dataset. The two most frequently used implementations are :pyalpenglow.cpp.DataframeData and :pyalpenglow.cpp.LegacyRecommenderData.

Interface :pyalpenglow.cpp.RecommenderDataIterator is the anchestor for classes that serve the data to the classes in the online experiment. See /general/anatomy_of_experiment for general information. The most frequently used implementations are :pyalpenglow.cpp.ShuffleIterator and :pyalpenglow.cpp.SimpleIterator.

alpenglow.cpp.RandomOnlineIteratorParameters

alpenglow.cpp.RandomOnlineIterator

alpenglow.cpp.ShuffleIteratorParameters

alpenglow.cpp.ShuffleIterator

alpenglow.cpp.DataframeData

alpenglow.cpp.SimpleIterator

alpenglow.cpp.RecommenderDataIterator

alpenglow.cpp.FactorRepr

alpenglow.cpp.UserItemFactors

alpenglow.cpp.FactorModelReader

alpenglow.cpp.EigenFactorModelReader

alpenglow.cpp.RandomIteratorParameters

alpenglow.cpp.RandomIterator

alpenglow.cpp.InlineAttributeReader

alpenglow.cpp.RecDat

alpenglow.cpp.RecPred

alpenglow.cpp.RecommenderData

alpenglow.cpp.LegacyRecommenderDataParameters

alpenglow.cpp.LegacyRecommenderData

Utils

This module contains miscellaneous helper classes.

alpenglow.cpp.PeriodComputerParameters

alpenglow.cpp.PeriodComputer

alpenglow.cpp.SpMatrix

alpenglow.cpp.Random

alpenglow.cpp.RankComputerParameters

alpenglow.cpp.RankComputer

alpenglow.cpp.Bias

alpenglow.cpp.SparseAttributeContainerParameters

alpenglow.cpp.SparseAttributeContainer

alpenglow.cpp.FileSparseAttributeContainer

alpenglow.cpp.Recency

alpenglow.cpp.PowerLawRecencyParameters

alpenglow.cpp.PowerLawRecency

alpenglow.cpp.PopContainer

alpenglow.cpp.TopPopContainer

alpenglow.cpp.ToplistCreatorParameters

alpenglow.cpp.ToplistCreator

alpenglow.cpp.ToplistCreatorGlobalParameters

alpenglow.cpp.ToplistCreatorGlobal

alpenglow.cpp.ToplistCreatorPersonalizedParameters

alpenglow.cpp.ToplistCreatorPersonalized

Gradient computers

This module contains the gradient computer classes that implement gradient computation necessary in gradient methods. See :pyalpenglow.experiments.FactorExperiment for an example.

alpenglow.cpp.GradientComputer

alpenglow.cpp.GradientComputerPointWise

Objectives

This module contains the implementation of objective functions that are necessary for gradient computation in gradient learning methods. See :pyalpenglow.experiments.FactorExperiment for a usage example.

alpenglow.cpp.ObjectiveMSE

alpenglow.cpp.ObjectivePointWise

alpenglow.cpp.ObjectivePairWise

alpenglow.cpp.ObjectiveListWise

General interfaces

This module contains the general interfaces that are implemented by classes belonging to different modules.

alpenglow.cpp.Initializable

alpenglow.cpp.Updater

alpenglow.cpp.NeedsExperimentEnvironment

Negative sample generators

All the samples in an implicit dataset are positive samples. To make gradient methods work, we need to provide negative samples too. This module contains classes that implement different negative sample generation algorithms. These classes implement :pyalpenglow.cpp.NegativeSampleGenerator. The most frequently used implementation is :pyalpenglow.cpp.UniformNegativeSampleGenerator.

alpenglow.cpp.UniformNegativeSampleGeneratorParameters

alpenglow.cpp.UniformNegativeSampleGenerator

alpenglow.cpp.PooledPositiveSampleGeneratorParameters

alpenglow.cpp.PooledPositiveSampleGenerator

alpenglow.cpp.NegativeSampleGenerator

Offline learners

Use offline learners in traditional, fixed train/test split style learning. Check the code of :pyalpenglow.offline.OfflineModel.OfflineModel descendants for usage examples.

alpenglow.cpp.OfflineIteratingOnlineLearnerWrapperParameters

alpenglow.cpp.OfflineIteratingOnlineLearnerWrapper

alpenglow.cpp.OfflineEigenFactorModelALSLearnerParameters

alpenglow.cpp.OfflineEigenFactorModelALSLearner

alpenglow.cpp.OfflineLearner

alpenglow.cpp.OfflineExternalModelLearnerParameters

alpenglow.cpp.OfflineExternalModelLearner

Loggers

Loggers implement evaluators, statistics etc. in the online experiment. These classes implement interface :pyalpenglow.cpp.Logger. See /general/anatomy_of_experiment for a general view.

alpenglow.cpp.OnlinePredictions

alpenglow.cpp.PredictionLogger

alpenglow.cpp.RankingLog

alpenglow.cpp.RankingLogs

alpenglow.cpp.MemoryRankingLoggerParameters

alpenglow.cpp.MemoryRankingLogger

alpenglow.cpp.ProceedingLogger

alpenglow.cpp.TransitionModelLoggerParameters

alpenglow.cpp.TransitionModelLogger

alpenglow.cpp.Logger

alpenglow.cpp.OnlinePredictorParameters

alpenglow.cpp.OnlinePredictor

alpenglow.cpp.MemoryUsageLogger

alpenglow.cpp.InterruptLogger

alpenglow.cpp.ConditionalMetaLogger

alpenglow.cpp.ListConditionalMetaLoggerParameters

alpenglow.cpp.ListConditionalMetaLogger

alpenglow.cpp.InputLoggerParameters

alpenglow.cpp.InputLogger

Online experiment

The central classes of the online experiments.

alpenglow.cpp.OnlineExperimentParameters

alpenglow.cpp.OnlineExperiment

alpenglow.cpp.ExperimentEnvironment

Models

The prediction models in the experiments. The model interface is :pyalpenglow.cpp.Model. See /general/rank_computing_optimization about different evaluation methods.

Factor models

This module contains the matrix factorization based models.

alpenglow.cpp.EigenFactorModelParameters

alpenglow.cpp.EigenFactorModel

alpenglow.cpp.FactorModelUpdater

alpenglow.cpp.FmModelUpdaterParameters

alpenglow.cpp.FmModelUpdater

alpenglow.cpp.FmModelParameters

alpenglow.cpp.FmModel

alpenglow.cpp.AsymmetricFactorModelGradientUpdaterParameters

alpenglow.cpp.AsymmetricFactorModelGradientUpdater

alpenglow.cpp.SvdppModelUpdater

alpenglow.cpp.FactorModelParameters

alpenglow.cpp.FactorModel

alpenglow.cpp.AsymmetricFactorModelUpdater

alpenglow.cpp.SvdppModelGradientUpdaterParameters

alpenglow.cpp.SvdppModelGradientUpdater

alpenglow.cpp.FactorModelGlobalRankingScoreIterator

alpenglow.cpp.SvdppModelParameters

alpenglow.cpp.SvdppModel

alpenglow.cpp.FactorModelGradientUpdaterParameters

alpenglow.cpp.FactorModelGradientUpdater

alpenglow.cpp.AsymmetricFactorModelParameters

alpenglow.cpp.AsymmetricFactorModel

Baseline models

This submodule contains the simple baseline models like nearest neighbor or most popular.

alpenglow.cpp.TransitionProbabilityModel

alpenglow.cpp.NearestNeighborModelParameters

alpenglow.cpp.NearestNeighborModel

alpenglow.cpp.PopularityTimeFrameModelUpdaterParameters

alpenglow.cpp.PopularityTimeFrameModelUpdater

alpenglow.cpp.PersonalPopularityModel

alpenglow.cpp.PersonalPopularityModelUpdater

alpenglow.cpp.PopularityModel

alpenglow.cpp.NearestNeighborModelUpdaterParameters

alpenglow.cpp.NearestNeighborModelUpdater

alpenglow.cpp.TransitionProbabilityModelUpdaterParameters

alpenglow.cpp.TransitionProbabilityModelUpdater

alpenglow.cpp.PopularityModelUpdater

Model combination

This module contains the models that combine other models. The most frequently used class is :pyalpenglow.cpp.CombinedModel. See /general/combination for a usage example.

alpenglow.cpp.ToplistCombinationModelParameters

alpenglow.cpp.ToplistCombinationModel

alpenglow.cpp.WeightedModelStructure

alpenglow.cpp.WMSUpdater

alpenglow.cpp.RandomChoosingCombinedModelParameters

alpenglow.cpp.RandomChoosingCombinedModel

alpenglow.cpp.CombinedModelParameters

alpenglow.cpp.CombinedModel

alpenglow.cpp.RandomChoosingCombinedModelExpertUpdaterParameters

alpenglow.cpp.RandomChoosingCombinedModelExpertUpdater

alpenglow.cpp.Evaluator

alpenglow.cpp.CombinedDoubleLayerModelGradientUpdaterParameters

alpenglow.cpp.CombinedDoubleLayerModelGradientUpdater

alpenglow.cpp.TopListRecommender

alpenglow.cpp.MassPredictor

alpenglow.cpp.Model

alpenglow.cpp.ExternalModelParameters

alpenglow.cpp.ExternalModel

alpenglow.cpp.PythonModel

alpenglow.cpp.PythonToplistModel

alpenglow.cpp.PythonRankingIteratorModel

alpenglow.cpp.SimilarityModel

alpenglow.cpp.ModelGradientUpdater

alpenglow.cpp.ModelMultiUpdater

alpenglow.cpp.RankingScoreIteratorProvider

alpenglow.cpp.GlobalRankingScoreIterator

Data generators

The classes in this module are responsible for generating data subsets from the past. This is necessary for embedding offline models into the online framework, that needs to be updated in a batch. See :pyalpenglow.experiments.BatchFactorExperiment for a usage example.

alpenglow.cpp.DataGenerator

alpenglow.cpp.SamplingDataGeneratorParameters

alpenglow.cpp.SamplingDataGenerator

alpenglow.cpp.CompletePastDataGenerator

alpenglow.cpp.TimeframeDataGeneratorParameters

alpenglow.cpp.TimeframeDataGenerator

Online learners

This module contains classes that modifiy the learning process, e.g. delay the samples or feed them in a batch into offline learning methods.

alpenglow.cpp.LearnerPeriodicDelayedWrapperParameters

alpenglow.cpp.LearnerPeriodicDelayedWrapper

alpenglow.cpp.PeriodicOfflineLearnerWrapperParameters

alpenglow.cpp.PeriodicOfflineLearnerWrapper