class_docstr: MatrixFactorizationBase contains common functionality for recommendation models.
  
  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
  num_threads : int
      The number of threads to use for batch recommendation calls and fitting the
      model. Setting to 0 will use all CPU cores on the machine
class_docstr_tok: ["MatrixFactorizationBase","contains","common","functionality","for","recommendation","models",".","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","num_threads",":","int","The","number","of","threads","to","use","for","batch","recommendation","calls","and","fitting","the","model",".","Setting","to","0","will","use","all","CPU","cores","on","the","machine"]
code: def similar_items(
      self,
      itemid,
      N=10,
      recalculate_item=False,
      item_users=None,
      filter_items=None,
      items=None,
  ):
      factor = self._item_factor(itemid, item_users, recalculate_item)
      factors = self.item_factors
      norms = self.item_norms
  
      if recalculate_item:
          if np.isscalar(itemid):
              norm = np.linalg.norm(factor)
              norm = norm if norm != 0 else 1e-10
          else:
              norm = np.linalg.norm(factor, axis=1)
              norm[norm == 0] = 1e-10
      else:
          norm = norms[itemid]
  
      # if we have an item list to restrict down to, we need to filter the item_factors
      if items is not None:
          if filter_items:
              raise ValueError(
                  "Can't set both items and filter_items in similar_items call"
              )
  
          items = np.array(items)
          factors = factors[items]
          norms = norms[items]
  
          # check selected items are in the model
          if (
              items.max() >= self.item_factors.shape[0]
              or items.min() < 0
          ):
              raise IndexError(
                  "Some itemids in the items parameter are not in the model"
              )
  
      ids, scores = self._get_similarity_score(
          factor, norm, factors, norms, N, filter_items=filter_items
      )
      if items is not None:
          ids = items[ids]
      return ids, scores
  
imports: import warnings
  import numpy
  from scipy.sparse import csr_matrix, lil_matrix
  from ..recommender_base import ModelFitError, RecommenderBase
  from .topk import topk
label_desc: Use image node_id 9 for calling the MatrixFactorizationBase obj's underlying member method code with example usage: obj.similar_items(itemid, N, recalculate_item, item_users, filter_items, items) and returns: ids,  scores