class_docstr: Dataset class for NCF
class_docstr_tok: ["Dataset","class","for","NCF"]
code: def _create_test_file(self):
      logger.info(
          "Creating full leave-one-out test file {} ...".format(
              self.test_file_full
          )
      )
  
      # create empty csv
      pd.DataFrame(
          columns=[
              self.col_user,
              self.col_item,
              self.col_rating,
              self.col_test_batch,
          ]
      ).to_csv(self.test_file_full, index=False)
  
      batch_idx = 0
  
      with self.train_datafile as train_datafile:
          with self.test_datafile as test_datafile:
              for user in tqdm(test_datafile.users):
                  if user in train_datafile.users:
                      user_test_data = test_datafile.load_data(user)
                      user_train_data = train_datafile.load_data(user)
                      # for leave-one-out evaluation, exclude items seen in both training and test sets
                      # when sampling negatives
                      user_positive_item_pool = set(
                          user_test_data[self.col_item].unique()
                      ).union(user_train_data[self.col_item].unique())
                      sampler = NegativeSampler(
                          user,
                          self.n_neg_test,
                          user_positive_item_pool,
                          self.train_datafile.items,
                          self.sample_with_replacement,
                          self.print_warnings,
                          training=False,
                      )
  
                      user_examples_dfs = []
                      # sample n_neg_test negatives for each positive example and assign a batch index
                      for positive_example in np.array_split(
                          user_test_data, user_test_data.shape[0]
                      ):
                          negative_examples = (
                              self._create_negative_examples_df(
                                  user, sampler.sample()
                              )
                          )
                          examples = pd.concat(
                              [positive_example, negative_examples]
                          )
                          examples[self.col_test_batch] = batch_idx
                          user_examples_dfs.append(examples)
                          batch_idx += 1
                      # append user test data to file
                      user_examples = pd.concat(user_examples_dfs)
                      user_examples.to_csv(
                          self.test_file_full,
                          mode="a",
                          index=False,
                          header=False,
                      )
  
imports: import os
  from collections import OrderedDict
  import random
  import numpy
  import pandas
  import csv
  import logging
  from tqdm import tqdm
  from recommenders.utils.constants import DEFAULT_ITEM_COL, DEFAULT_USER_COL, DEFAULT_RATING_COL
label_desc: Use image node_id 3 for calling the Dataset obj's underlying member method code with example usage: obj._create_test_file() without return types