code: def load_dataset(data_dir="./", dataset="ml-1m", num_ng=4):
      """
      data_dir: the path to the dataset;
      dataset: the name of the dataset;
      num_ng: number of negative samples to be sampled here.
      """
      (
          users,
          items,
          user_num,
          item_num,
          sparse_features,
          dense_features,
          total_cols,
      ) = process_users_items(data_dir, dataset)
      ratings, train_mat = process_ratings(
          data_dir, dataset, user_num, item_num
      )
  
      # Negative sampling
      dataset = NCFData(
          ratings.values.tolist(),
          num_item=item_num,
          train_mat=train_mat,
          num_ng=num_ng,
      )
      dataset.ng_sample()
  
      # Merge features
      dataset.merge_features(users, items, total_cols[:-1])
  
      # Split dataset
      train_dataset, test_dataset = dataset.train_test_split()
      return train_dataset, test_dataset
  
imports: import os
  import tempfile
  import numpy
  import pandas
  import scipy.sparse
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import MinMaxScaler
  import torch.utils.data
  from bigdl.dllib.utils.file_utils import is_local_path
  from bigdl.orca.data.file import get_remote_dir_to_local, get_remote_file_to_local
label_desc: Use image node_id 4 for calling a global function with example usage: load_dataset(data_dir, dataset, num_ng) and returns: train_dataset,  test_dataset