code: def from_labeled_point(
      rdd: RDD, categorical: bool = False, nb_classes: int = None
  ):
      """Convert a LabeledPoint RDD back to a pair of numpy arrays
  
      :param rdd: LabeledPoint RDD
      :param categorical: boolean, if labels should be one-hot encode when returned
      :param nb_classes: optional int, indicating the number of class labels
      :return: pair of numpy arrays, features and labels
      """
      features = np.asarray(
          rdd.map(lambda lp: from_vector(lp.features)).collect()
      )
      labels = np.asarray(
          rdd.map(lambda lp: lp.label).collect(), dtype="int32"
      )
      if categorical:
          if not nb_classes:
              nb_classes = np.max(labels) + 1
          temp = np.zeros((len(labels), nb_classes))
          for i, label in enumerate(labels):
              temp[i, label] = 1.0
          labels = temp
      return features, labels
  
file_path: elephas/elephas/utils/rdd_utils.py
imports: from pyspark import RDD, SparkContext
  from pyspark.mllib.regression import LabeledPoint
  import numpy
  from ..mllib.adapter import to_vector, from_vector
label_desc: Use image node_id 3 for calling a global function with example usage: from_labeled_point(rdd, categorical, nb_classes) and returns: features,  labels