class_docstr: Cross-validation iterator where each user has exactly one rating in the
  testset.
  
  Contrary to other cross-validation strategies, ``LeaveOneOut`` does not
  guarantee that all folds will be different, although this is still very
  likely for sizeable datasets.
  
  See an example in the :ref:`User Guide <use_cross_validation_iterators>`.
  
  Args:
      n_splits(int): The number of folds.
      random_state(int, RandomState instance from numpy, or ``None``):
          Determines the RNG that will be used for determining the folds. If
          int, ``random_state`` will be used as a seed for a new RNG. This is
          useful to get the same splits over multiple calls to ``split()``.
          If RandomState instance, this same instance is used as RNG. If
          ``None``, the current RNG from numpy is used. ``random_state`` is
          only used if ``shuffle`` is ``True``.  Default is ``None``.
      min_n_ratings(int): Minimum number of ratings for each user in the
          trainset. E.g. if ``min_n_ratings`` is ``2``, we are sure each user
          has at least ``2`` ratings in the trainset (and ``1`` in the
          testset). Other users are discarded. Default is ``0``, so some
          users (having only one rating) may be in the testset and not in the
          trainset.
class_docstr_tok: ["Cross-validation","iterator","where","each","user","has","exactly","one","rating","in","the","testset",".","Contrary","to","other","cross-validation","strategies",",","``","LeaveOneOut","``","does","not","guarantee","that","all","folds","will","be","different",",","although","this","is","still","very","likely","for","sizeable","datasets",".","See","an","example","in","the",":","ref",":","`","User","Guide","<","use_cross_validation_iterators",">","`",".","Args",":","n_splits","(","int",")",":","The","number","of","folds",".","random_state","(","int",",","RandomState","instance","from","numpy",",","or","``","None","``",")",":","Determines","the","RNG","that","will","be","used","for","determining","the","folds",".","If","int",",","``","random_state","``","will","be","used","as","a","seed","for","a","new","RNG",".","This","is","useful","to","get","the","same","splits","over","multiple","calls","to","``","split","(",")","``",".","If","RandomState","instance",",","this","same","instance","is","used","as","RNG",".","If","``","None","``",",","the","current","RNG","from","numpy","is","used",".","``","random_state","``","is","only","used","if","``","shuffle","``","is","``","True","``",".","Default","is","``","None","``",".","min_n_ratings","(","int",")",":","Minimum","number","of","ratings","for","each","user","in","the","trainset",".","E.g",".","if","``","min_n_ratings","``","is","``","2","``",",","we","are","sure","each","user","has","at","least","``","2","``","ratings","in","the","trainset","(","and","``","1","``","in","the","testset",")",".","Other","users","are","discarded",".","Default","is","``","0","``",",","so","some","users","(","having","only","one","rating",")","may","be","in","the","testset","and","not","in","the","trainset","."]
code: def __init__(self, n_splits=5, random_state=None, min_n_ratings=0):
      self.n_splits = n_splits
      self.random_state = random_state
      self.min_n_ratings = min_n_ratings
  
imports: import numbers
  from collections import defaultdict
  from itertools import chain
  from math import ceil, floor
  import numpy
  from ..utils import get_rng
label_desc: Use image node_id 1 to create a new LeaveOneOut object  with example: obj = LeaveOneOut(n_splits, random_state, min_n_ratings)