class_docstr: Helper methods to load, save and pre-process data used in MLlib.
  
  .. versionadded:: 1.0.0
docstr: Load labeled points saved using RDD.saveAsTextFile.
  
  .. versionadded:: 1.0.0
  
  Parameters
  ----------
  sc : :py:class:`pyspark.SparkContext`
      Spark context
  path : str
      file or directory path in any Hadoop-supported file system URI
  minPartitions : int, optional
      min number of partitions
  
  Returns
  -------
  :py:class:`pyspark.RDD`
      labeled data stored as an RDD of LabeledPoint
  
  Examples
  --------
  >>> from tempfile import NamedTemporaryFile
  >>> from pyspark.mllib.util import MLUtils
  >>> from pyspark.mllib.regression import LabeledPoint
  >>> examples = [LabeledPoint(1.1, Vectors.sparse(3, [(0, -1.23), (2, 4.56e-7)])),
  ...             LabeledPoint(0.0, Vectors.dense([1.01, 2.02, 3.03]))]
  >>> tempFile = NamedTemporaryFile(delete=True)
  >>> tempFile.close()
  >>> sc.parallelize(examples, 1).saveAsTextFile(tempFile.name)
  >>> MLUtils.loadLabeledPoints(sc, tempFile.name).collect()
  [LabeledPoint(1.1, (3,[0,2],[-1.23,4.56e-07])), LabeledPoint(0.0, [1.01,2.02,3.03])]
docstr_tok: ["Load","labeled","points","saved","using","RDD.saveAsTextFile",".","..","versionadded",":",":","1.0.0","Parameters","--","--","--","--","--","sc",":",":","py",":","class",":","`","pyspark.SparkContext","`","Spark","context","path",":","str","file","or","directory","path","in","any","Hadoop-supported","file","system","URI","minPartitions",":","int",",","optional","min","number","of","partitions","Returns","--","--","--","-",":","py",":","class",":","`","pyspark.RDD","`","labeled","data","stored","as","an","RDD","of","LabeledPoint","Examples","--","--","--","--",">",">",">","from","tempfile","import","NamedTemporaryFile",">",">",">","from","pyspark.mllib.util","import","MLUtils",">",">",">","from","pyspark.mllib.regression","import","LabeledPoint",">",">",">","examples","=","[","LabeledPoint","(","1.1",",","Vectors.sparse","(","3",",","[","(","0",",","-1.23",")",",","(","2",",","4.56e-7",")","]",")",")",",","...","LabeledPoint","(","0.0",",","Vectors.dense","(","[","1.01",",","2.02",",","3.03","]",")",")","]",">",">",">","tempFile","=","NamedTemporaryFile","(","delete=True",")",">",">",">","tempFile.close","(",")",">",">",">","sc.parallelize","(","examples",",","1",")",".saveAsTextFile","(","tempFile.name",")",">",">",">","MLUtils.loadLabeledPoints","(","sc",",","tempFile.name",")",".collect","(",")","[","LabeledPoint","(","1.1",",","(","3",",","[","0,2","]",",","[","-1.23,4.56e-07","]",")",")",",","LabeledPoint","(","0.0",",","[","1.01,2.02,3.03","]",")","]"]
code: def loadLabeledPoints(
      sc: SparkContext, path: str, minPartitions: Optional[int] = None
  ) -> RDD["LabeledPoint"]:
      """
      Load labeled points saved using RDD.saveAsTextFile.
  
      .. versionadded:: 1.0.0
  
      Parameters
      ----------
      sc : :py:class:`pyspark.SparkContext`
          Spark context
      path : str
          file or directory path in any Hadoop-supported file system URI
      minPartitions : int, optional
          min number of partitions
  
      Returns
      -------
      :py:class:`pyspark.RDD`
          labeled data stored as an RDD of LabeledPoint
  
      Examples
      --------
      >>> from tempfile import NamedTemporaryFile
      >>> from pyspark.mllib.util import MLUtils
      >>> from pyspark.mllib.regression import LabeledPoint
      >>> examples = [LabeledPoint(1.1, Vectors.sparse(3, [(0, -1.23), (2, 4.56e-7)])),
      ...             LabeledPoint(0.0, Vectors.dense([1.01, 2.02, 3.03]))]
      >>> tempFile = NamedTemporaryFile(delete=True)
      >>> tempFile.close()
      >>> sc.parallelize(examples, 1).saveAsTextFile(tempFile.name)
      >>> MLUtils.loadLabeledPoints(sc, tempFile.name).collect()
      [LabeledPoint(1.1, (3,[0,2],[-1.23,4.56e-07])), LabeledPoint(0.0, [1.01,2.02,3.03])]
      """
      minPartitions = minPartitions or min(sc.defaultParallelism, 2)
      return callMLlibFunc("loadLabeledPoints", sc, path, minPartitions)
  
imports: import sys
  from functools import reduce
  import numpy
  from pyspark import SparkContext, since
  from pyspark.mllib.common import callMLlibFunc, inherit_doc
  from pyspark.mllib.linalg import Vectors, SparseVector, _convert_to_vector
  from pyspark.sql import DataFrame
  from typing import Generic, Iterable, List, Optional, Tuple, Type, TypeVar, cast, TYPE_CHECKING
  from pyspark.context import SparkContext
  from pyspark.mllib.linalg import Vector
  from pyspark.rdd import RDD
  from pyspark.sql.dataframe import DataFrame
label_desc: Use image node_id 5 for calling the MLUtils obj's underlying member method code with example usage: obj.loadLabeledPoints(sc, path, minPartitions) and returns: callMLlibFunc