class_docstr: DataFile class for NCF. Iterator to read data from a csv file.
  Data must be sorted by user. Includes utilities for loading user data from
  file, formatting it and returning a Pandas dataframe.
class_docstr_tok: ["DataFile","class","for","NCF",".","Iterator","to","read","data","from","a","csv","file",".","Data","must","be","sorted","by","user",".","Includes","utilities","for","loading","user","data","from","file",",","formatting","it","and","returning","a","Pandas","dataframe","."]
code: def _extract_row_data(self, row):
      if row is None:
          return row
      user = int(row[self.col_user])
      item = int(row[self.col_item])
      rating = float(row[self.col_rating])
      if self.binary:
          rating = float(rating > 0)
      test_batch = None
      if self.col_test_batch:
          test_batch = int(row[self.col_test_batch])
      return {
          self.col_user: user,
          self.col_item: item,
          self.col_rating: rating,
          self.col_test_batch: test_batch,
      }
  
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 10 for calling the DataFile obj's underlying member method code with example usage: obj._extract_row_data(row) and returns: dict, row