class_docstr: Bayesian Personalized Ranking
  
  A recommender model that learns  a matrix factorization embedding based off minimizing the
  pairwise ranking loss described in the paper `BPR: Bayesian Personalized Ranking from Implicit
  Feedback <https://arxiv.org/pdf/1205.2618.pdf>`_.
  
  Parameters
  ----------
  factors : int, optional
      The number of latent factors to compute
  learning_rate : float, optional
      The learning rate to apply for SGD updates during training
  regularization : float, optional
      The regularization factor to use
  iterations : int, optional
      The number of training epochs to use when fitting the data
  verify_negative_samples: bool, optional
      When sampling negative items, check if the randomly picked negative item has actually
      been liked by the user. This check increases the time needed to train but usually leads
      to better predictions.
  random_state : int, RandomState, Generator or None, optional
      The random state for seeding the initial item and user factors.
      Default is None.
  
  Attributes
  ----------
  item_factors : ndarray
      Array of latent factors for each item in the training set
  user_factors : ndarray
      Array of latent factors for each user in the training set
code: def __init__(
      self,
      factors=100,
      learning_rate=0.01,
      regularization=0.01,
      dtype=np.float32,
      iterations=100,
      verify_negative_samples=True,
      random_state=None,
  ):
      super().__init__()
      if not implicit.gpu.HAS_CUDA:
          raise ValueError(
              "No CUDA extension has been built, can't train on GPU."
          )
  
      self.factors = factors
      self.learning_rate = learning_rate
      self.iterations = iterations
      self.regularization = regularization
      self.verify_negative_samples = verify_negative_samples
      self.random_state = random_state
  
file_path: implicit/implicit/gpu/bpr.py
imports: import logging
  import time
  import numpy
  from tqdm.auto import tqdm
  import implicit.gpu
  from ..utils import check_csr, check_random_state
  from .matrix_factorization_base import MatrixFactorizationBase
label_desc: Use image node_id 1 to create a new BayesianPersonalizedRanking object from inherited base classes: MatrixFactorizationBase with example: obj = BayesianPersonalizedRanking(factors, learning_rate, regularization, dtype, iterations, verify_negative_samples, random_state)