docstr: Initial function.
  Parameters:
  data: NumPy 2D or pandas DataFrame of features data.
  label: one-dimensional array, it presents samples label.
  field_map: one-dimensional array, it presents the features'field respectively.
  This field_map like, [1, 2, 1, 3] means, the first and third features belong to field one, and the second belongs to field two, and so on.
  this parameter only useful for ffm model.
  Note: we only do roughly check, and do detail check in true work function.
docstr_tok: ["Initial","function",".","Parameters",":","data",":","NumPy","2D","or","pandas","DataFrame","of","features","data",".","label",":","one-dimensional","array",",","it","presents","samples","label",".","field_map",":","one-dimensional","array",",","it","presents","the","features'field","respectively",".","This","field_map","like",",","[","1",",","2",",","1",",","3","]","means",",","the","first","and","third","features","belong","to","field","one",",","and","the","second","belongs","to","field","two",",","and","so","on",".","this","parameter","only","useful","for","ffm","model",".","Note",":","we","only","do","roughly","check",",","and","do","detail","check","in","true","work","function","."]
code: def __init__(self, data, label=None, field_map=None):
      """
      Initial function.
      Parameters:
      data: NumPy 2D or pandas DataFrame of features data.
      label: one-dimensional array, it presents samples label.
      field_map: one-dimensional array, it presents the features'field respectively.
      This field_map like, [1, 2, 1, 3] means, the first and third features belong to field one, and the second belongs to field two, and so on.
      this parameter only useful for ffm model.
      Note: we only do roughly check, and do detail check in true work function.
      """
  
      self.__handle = ctypes.c_void_p()
      if isinstance(data, ndarray) or isinstance(data, DataFrame):
          self._init_from_npy2d(data, label, field_map)
      else:
          raise ValueError(
              "Input data must be numpy.ndarray or pandas.DataFrame"
          )
  
file_path: xlearn/python-package/xlearn/data.py
imports: import os, ctypes
  from numpy import ndarray
  from .base import DataFrame, Series
  import numpy
  from .base import _LIB, XLearnHandle
  from .base import _check_call, c_str
label_desc: Use image node_id 1 to create a new DMatrix object from inherited base classes: object with example: obj = DMatrix(data, label, field_map)