class_docstr: A set of data which is used in the model optimization process. The FeatureSet can be accessed in
  a random data sample sequence. In the training process, the data sequence is a looped endless
  sequence. While in the validation process, the data sequence is a limited length sequence.
  Different from BigDL's DataSet, this FeatureSet could be cached to Intel Optane DC Persistent
  Memory, if you set memory_type to PMEM when creating FeatureSet.
class_docstr_tok: ["A","set","of","data","which","is","used","in","the","model","optimization","process",".","The","FeatureSet","can","be","accessed","in","a","random","data","sample","sequence",".","In","the","training","process",",","the","data","sequence","is","a","looped","endless","sequence",".","While","in","the","validation","process",",","the","data","sequence","is","a","limited","length","sequence",".","Different","from","BigDL","'s","DataSet",",","this","FeatureSet","could","be","cached","to","Intel","Optane","DC","Persistent","Memory",",","if","you","set","memory_type","to","PMEM","when","creating","FeatureSet","."]
docstr: Create FeatureSet from RDD[Sample].
  :param rdd: A RDD[Sample]
  :param memory_type: string, DRAM or PMEM
                      If it's DRAM, will cache dataset into dynamic random-access memory
                      If it's PMEM, will cache dataset into Intel Optane DC Persistent Memory
                      If it's DISK_n where n is an int, will cache dataset into disk,
                      and only hold 1/n of the data into memory during the training.
                      After going through the 1/n, we will release the current cache,
                      and load another 1/n into memory.
  :param sequential_order: whether to iterate the elements in the feature set
                           in sequential order when training.
  :param shuffle: whether to shuffle the elements in each partition before each epoch
                  when training
  :param bigdl_type:numeric type
  :return: A feature set
docstr_tok: ["Create","FeatureSet","from","RDD","[","Sample","]",".",":","param","rdd",":","A","RDD","[","Sample","]",":","param","memory_type",":","string",",","DRAM","or","PMEM","If","it","'s","DRAM",",","will","cache","dataset","into","dynamic","random-access","memory","If","it","'s","PMEM",",","will","cache","dataset","into","Intel","Optane","DC","Persistent","Memory","If","it","'s","DISK_n","where","n","is","an","int",",","will","cache","dataset","into","disk",",","and","only","hold","1\/n","of","the","data","into","memory","during","the","training",".","After","going","through","the","1\/n",",","we","will","release","the","current","cache",",","and","load","another","1\/n","into","memory",".",":","param","sequential_order",":","whether","to","iterate","the","elements","in","the","feature","set","in","sequential","order","when","training",".",":","param","shuffle",":","whether","to","shuffle","the","elements","in","each","partition","before","each","epoch","when","training",":","param","bigdl_type",":","numeric","type",":","return",":","A","feature","set"]
code: def sample_rdd(
      cls,
      rdd,
      memory_type="DRAM",
      sequential_order=False,
      shuffle=True,
      bigdl_type="float",
  ):
      """
      Create FeatureSet from RDD[Sample].
      :param rdd: A RDD[Sample]
      :param memory_type: string, DRAM or PMEM
                          If it's DRAM, will cache dataset into dynamic random-access memory
                          If it's PMEM, will cache dataset into Intel Optane DC Persistent Memory
                          If it's DISK_n where n is an int, will cache dataset into disk,
                          and only hold 1/n of the data into memory during the training.
                          After going through the 1/n, we will release the current cache,
                          and load another 1/n into memory.
      :param sequential_order: whether to iterate the elements in the feature set
                               in sequential order when training.
      :param shuffle: whether to shuffle the elements in each partition before each epoch
                      when training
      :param bigdl_type:numeric type
      :return: A feature set
      """
      jvalue = callZooFunc(
          bigdl_type,
          "createSampleFeatureSetFromRDD",
          rdd,
          memory_type,
          sequential_order,
          shuffle,
      )
      return cls(jvalue=jvalue)
  
imports: from bigdl.dllib.utils.common import *
  from bigdl.dllib.utils.file_utils import callZooFunc
  from bigdl.dllib.feature.dataset.dataset import DataSet
  from pyspark.serializers import CloudPickleSerializer
  import sys
  import math
  import warnings
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 4 for calling the FeatureSet obj's underlying member method code with example usage: obj.sample_rdd(cls, rdd, memory_type, sequential_order, shuffle, bigdl_type) and returns: cls