Object

org.apache.spark.mllib.util

MLUtils

Related Doc: package util

Permalink

object MLUtils

Helper methods to load, save and pre-process data used in ML Lib.

Annotations
@Since( "0.8.0" )
Source
MLUtils.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MLUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def appendBias(vector: Vector): Vector

    Permalink

    Returns a new vector with 1.0 (bias) appended to the input vector.

    Returns a new vector with 1.0 (bias) appended to the input vector.

    Annotations
    @Since( "1.0.0" )
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def kFold[T](rdd: RDD[T], numFolds: Int, seed: Long)(implicit arg0: ClassTag[T]): Array[(RDD[T], RDD[T])]

    Permalink

    Version of kFold() taking a Long seed.

    Version of kFold() taking a Long seed.

    Annotations
    @Since( "2.0.0" )
  14. def kFold[T](rdd: RDD[T], numFolds: Int, seed: Int)(implicit arg0: ClassTag[T]): Array[(RDD[T], RDD[T])]

    Permalink

    Return a k element array of pairs of RDDs with the first element of each pair containing the training data, a complement of the validation data and the second element, the validation data, containing a unique 1/kth of the data.

    Return a k element array of pairs of RDDs with the first element of each pair containing the training data, a complement of the validation data and the second element, the validation data, containing a unique 1/kth of the data. Where k=numFolds.

    Annotations
    @Since( "1.0.0" )
  15. def loadLabeledPoints(sc: SparkContext, dir: String): RDD[LabeledPoint]

    Permalink

    Loads labeled points saved using RDD[LabeledPoint].saveAsTextFile with the default number of partitions.

    Loads labeled points saved using RDD[LabeledPoint].saveAsTextFile with the default number of partitions.

    Annotations
    @Since( "1.1.0" )
  16. def loadLabeledPoints(sc: SparkContext, path: String, minPartitions: Int): RDD[LabeledPoint]

    Permalink

    Loads labeled points saved using RDD[LabeledPoint].saveAsTextFile.

    Loads labeled points saved using RDD[LabeledPoint].saveAsTextFile.

    sc

    Spark context

    path

    file or directory path in any Hadoop-supported file system URI

    minPartitions

    min number of partitions

    returns

    labeled points stored as an RDD[LabeledPoint]

    Annotations
    @Since( "1.1.0" )
  17. def loadLibSVMFile(sc: SparkContext, path: String): RDD[LabeledPoint]

    Permalink

    Loads binary labeled data in the LIBSVM format into an RDD[LabeledPoint], with number of features determined automatically and the default number of partitions.

    Loads binary labeled data in the LIBSVM format into an RDD[LabeledPoint], with number of features determined automatically and the default number of partitions.

    Annotations
    @Since( "1.0.0" )
  18. def loadLibSVMFile(sc: SparkContext, path: String, numFeatures: Int): RDD[LabeledPoint]

    Permalink

    Loads labeled data in the LIBSVM format into an RDD[LabeledPoint], with the default number of partitions.

    Loads labeled data in the LIBSVM format into an RDD[LabeledPoint], with the default number of partitions.

    Annotations
    @Since( "1.0.0" )
  19. def loadLibSVMFile(sc: SparkContext, path: String, numFeatures: Int, minPartitions: Int): RDD[LabeledPoint]

    Permalink

    Loads labeled data in the LIBSVM format into an RDD[LabeledPoint].

    Loads labeled data in the LIBSVM format into an RDD[LabeledPoint]. The LIBSVM format is a text-based format used by LIBSVM and LIBLINEAR. Each line represents a labeled sparse feature vector using the following format:

    label index1:value1 index2:value2 ...

    where the indices are one-based and in ascending order. This method parses each line into a org.apache.spark.mllib.regression.LabeledPoint, where the feature indices are converted to zero-based.

    sc

    Spark context

    path

    file or directory path in any Hadoop-supported file system URI

    numFeatures

    number of features, which will be determined from the input data if a nonpositive value is given. This is useful when the dataset is already split into multiple files and you want to load them separately, because some features may not present in certain files, which leads to inconsistent feature dimensions.

    minPartitions

    min number of partitions

    returns

    labeled data stored as an RDD[LabeledPoint]

    Annotations
    @Since( "1.0.0" )
  20. def loadVectors(sc: SparkContext, path: String): RDD[Vector]

    Permalink

    Loads vectors saved using RDD[Vector].saveAsTextFile with the default number of partitions.

    Loads vectors saved using RDD[Vector].saveAsTextFile with the default number of partitions.

    Annotations
    @Since( "1.1.0" )
  21. def loadVectors(sc: SparkContext, path: String, minPartitions: Int): RDD[Vector]

    Permalink

    Loads vectors saved using RDD[Vector].saveAsTextFile.

    Loads vectors saved using RDD[Vector].saveAsTextFile.

    sc

    Spark context

    path

    file or directory path in any Hadoop-supported file system URI

    minPartitions

    min number of partitions

    returns

    vectors stored as an RDD[Vector]

    Annotations
    @Since( "1.1.0" )
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. def saveAsLibSVMFile(data: RDD[LabeledPoint], dir: String): Unit

    Permalink

    Save labeled data in LIBSVM format.

    Save labeled data in LIBSVM format.

    data

    an RDD of LabeledPoint to be saved

    dir

    directory to save the data

    Annotations
    @Since( "1.0.0" )
    See also

    org.apache.spark.mllib.util.MLUtils#loadLibSVMFile

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped