Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package apache
    Definition Classes
    org
  • package spark

    Core Spark functionality.

    Core Spark functionality. org.apache.spark.SparkContext serves as the main entry point to Spark, while org.apache.spark.rdd.RDD is the data type representing a distributed collection, and provides most parallel operations.

    In addition, org.apache.spark.rdd.PairRDDFunctions contains operations available only on RDDs of key-value pairs, such as groupByKey and join; org.apache.spark.rdd.DoubleRDDFunctions contains operations available only on RDDs of Doubles; and org.apache.spark.rdd.SequenceFileRDDFunctions contains operations available on RDDs that can be saved as SequenceFiles. These operations are automatically available on any RDD of the right type (e.g. RDD[(Int, Int)] through implicit conversions.

    Java programmers should reference the org.apache.spark.api.java package for Spark programming APIs in Java.

    Classes and methods marked with Experimental are user-facing features which have not been officially adopted by the Spark project. These are subject to change or removal in minor releases.

    Classes and methods marked with Developer API are intended for advanced users want to extend Spark through lower level interfaces. These are subject to changes or removal in minor releases.

    Definition Classes
    apache
  • package ml

    DataFrame-based machine learning APIs to let users quickly assemble and configure practical machine learning pipelines.

    DataFrame-based machine learning APIs to let users quickly assemble and configure practical machine learning pipelines.

    Definition Classes
    spark
  • package stat
    Definition Classes
    ml
  • package distribution
    Definition Classes
    stat
  • ChiSquareTest
  • Correlation
  • KolmogorovSmirnovTest
  • Summarizer
  • SummaryBuilder

object Summarizer extends Logging

Tools for vectorized statistics on MLlib Vectors.

The methods in this package provide various statistics for Vectors contained inside DataFrames.

This class lets users pick the statistics they would like to extract for a given column. Here is an example in Scala:

import org.apache.spark.ml.linalg._
import org.apache.spark.sql.Row
val dataframe = ... // Some dataframe containing a feature column and a weight column
val multiStatsDF = dataframe.select(
    Summarizer.metrics("min", "max", "count").summary($"features", $"weight")
val Row(minVec, maxVec, count) = multiStatsDF.first()

If one wants to get a single metric, shortcuts are also available:

val meanDF = dataframe.select(Summarizer.mean($"features"))
val Row(meanVec) = meanDF.first()

Note: Currently, the performance of this interface is about 2x~3x slower than using the RDD interface.

Annotations
@Since("2.3.0")
Source
Summarizer.scala
Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Summarizer
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. implicit class LogStringContext extends AnyRef
    Definition Classes
    Logging

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. def count(col: Column): Column
    Annotations
    @Since("2.3.0")
  7. def count(col: Column, weightCol: Column): Column
    Annotations
    @Since("2.3.0")
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  12. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  13. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  16. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  17. def logDebug(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  18. def logDebug(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  19. def logDebug(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  20. def logDebug(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  21. def logError(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  22. def logError(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  23. def logError(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  24. def logError(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  25. def logInfo(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  26. def logInfo(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  27. def logInfo(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  28. def logInfo(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  29. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  30. def logTrace(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  31. def logTrace(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  32. def logTrace(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  33. def logTrace(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  34. def logWarning(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  35. def logWarning(entry: LogEntry, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  36. def logWarning(entry: LogEntry): Unit
    Attributes
    protected
    Definition Classes
    Logging
  37. def logWarning(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  38. def max(col: Column): Column
    Annotations
    @Since("2.3.0")
  39. def max(col: Column, weightCol: Column): Column
    Annotations
    @Since("2.3.0")
  40. def mean(col: Column): Column
    Annotations
    @Since("2.3.0")
  41. def mean(col: Column, weightCol: Column): Column
    Annotations
    @Since("2.3.0")
  42. def metrics(metrics: String*): SummaryBuilder

    Given a list of metrics, provides a builder that it turns computes metrics from a column.

    Given a list of metrics, provides a builder that it turns computes metrics from a column.

    See the documentation of Summarizer for an example.

    The following metrics are accepted (case sensitive):

    • mean: a vector that contains the coefficient-wise mean.
    • sum: a vector that contains the coefficient-wise sum.
    • variance: a vector that contains the coefficient-wise variance.
    • std: a vector that contains the coefficient-wise standard deviation.
    • count: the count of all vectors seen.
    • numNonzeros: a vector with the number of non-zeros for each coefficients
    • max: the maximum for each coefficient.
    • min: the minimum for each coefficient.
    • normL2: the Euclidean norm for each coefficient.
    • normL1: the L1 norm of each coefficient (sum of the absolute values).
    metrics

    metrics that can be provided.

    returns

    a builder.

    Annotations
    @Since("2.3.0") @varargs()
    Exceptions thrown

    IllegalArgumentException if one of the metric names is not understood. Note: Currently, the performance of this interface is about 2x~3x slower than using the RDD interface.

  43. def min(col: Column): Column
    Annotations
    @Since("2.3.0")
  44. def min(col: Column, weightCol: Column): Column
    Annotations
    @Since("2.3.0")
  45. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  46. def normL1(col: Column): Column
    Annotations
    @Since("2.3.0")
  47. def normL1(col: Column, weightCol: Column): Column
    Annotations
    @Since("2.3.0")
  48. def normL2(col: Column): Column
    Annotations
    @Since("2.3.0")
  49. def normL2(col: Column, weightCol: Column): Column
    Annotations
    @Since("2.3.0")
  50. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  51. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  52. def numNonZeros(col: Column): Column
    Annotations
    @Since("2.3.0")
  53. def numNonZeros(col: Column, weightCol: Column): Column
    Annotations
    @Since("2.3.0")
  54. def std(col: Column): Column
    Annotations
    @Since("3.0.0")
  55. def std(col: Column, weightCol: Column): Column
    Annotations
    @Since("3.0.0")
  56. def sum(col: Column): Column
    Annotations
    @Since("3.0.0")
  57. def sum(col: Column, weightCol: Column): Column
    Annotations
    @Since("3.0.0")
  58. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  59. def toString(): String
    Definition Classes
    AnyRef → Any
  60. def variance(col: Column): Column
    Annotations
    @Since("2.3.0")
  61. def variance(col: Column, weightCol: Column): Column
    Annotations
    @Since("2.3.0")
  62. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  63. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  64. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  65. def withLogContext(context: HashMap[String, String])(body: => Unit): Unit
    Attributes
    protected
    Definition Classes
    Logging

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Members