lenskit.flexmf.FlexMFImplicitConfig =================================== .. py:class:: lenskit.flexmf.FlexMFImplicitConfig :canonical: lenskit.flexmf._implicit.FlexMFImplicitConfig Bases: :py:obj:`lenskit.flexmf._base.FlexMFConfigBase` Configuration for :class:`FlexMFImplicitScorer`. It inherits base model options from :class:`FlexMFConfigBase`. :Stability: Experimental .. py:attribute:: preset :type: Literal['bpr', 'warp', 'lightgcn'] | None :value: None Select preset defaults to mimic a particular model's original presentation. .. py:attribute:: loss :type: ImplicitLoss :value: 'logistic' The loss to use for model training. .. py:attribute:: negative_strategy :type: NegativeStrategy | None :value: None The negative sampling strategy. The default is ``"misranked"`` for WARP loss and ``"uniform"`` for other losses. .. py:attribute:: negative_count :type: pydantic.PositiveInt :value: 1 The number of negative items to sample for each positive item in the training data. With BPR loss, the positive item is compared to each negative item; with logistic loss, the positive item is treated once per learning round, so this setting effectively makes the model learn on _n_ negatives per positive, rather than giving positive and negative examples equal weight. .. py:attribute:: positive_weight :type: pydantic.PositiveFloat :value: 1.0 A weighting multiplier to apply to the positive item's loss, to adjust the relative importance of positive and negative classifications. Only applies to logistic loss. .. py:attribute:: user_bias :type: bool | None :value: None Whether to learn a user bias term. If unspecified, the default depends on the loss function (``False`` for pairwise and ``True`` for logistic). .. py:attribute:: item_bias :type: bool :value: True Whether to learn an item bias term. .. py:attribute:: convolution_layers :type: pydantic.NonNegativeInt :value: 0 The number of LightGCN convolution layers to use. 0 (the default) configures for standard matrix factorization. .. py:method:: selected_negative_strategy() .. py:method:: apply_preset(data) :classmethod: .. py:method:: check_strategies()