org.apache.spark.streamdm.core

SparseInstance

case class SparseInstance(inIndexes: Array[Int], inValues: Array[Double]) extends Instance with Serializable with Product

A SparseInstance is an Instance in which the features are sparse, i.e., most features will not have any value. The SparseInstance will keep two Arrays: one with the values and one with the corresponding indexes. The implementation will be based on these two data structures.

Linear Supertypes
Product, Equals, Instance, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SparseInstance
  2. Product
  3. Equals
  4. Instance
  5. Serializable
  6. Serializable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SparseInstance(inIndexes: Array[Int], inValues: Array[Double])

Type Members

  1. type T = SparseInstance

    Definition Classes
    SparseInstanceInstance

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def add(input: Instance): SparseInstance

    Perform an element by element addition between two instances

    Perform an element by element addition between two instances

    input

    an Instance which is added up

    returns

    a SparseInstance representing the added Instances

    Definition Classes
    SparseInstanceInstance
  7. def apply(index: Int): Double

    Get the value present at position index

    Get the value present at position index

    index

    the index of the features

    returns

    a Double representing the feature value, or 0 if the index is not present in the underlying data structure

    Definition Classes
    SparseInstanceInstance
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def distanceTo(input: Instance): Double

    Compute the Euclidean distance to another Instance

    Compute the Euclidean distance to another Instance

    input

    the Instance to which the distance is computed

    returns

    a Double representing the distance value

    Definition Classes
    SparseInstanceInstance
  11. def dot(input: Instance): Double

    Perform a dot product between two instances

    Perform a dot product between two instances

    input

    an Instance with which the dot product is performed

    returns

    a Double representing the dot product

    Definition Classes
    SparseInstanceInstance
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  15. def getFeatureIndexArray(): Array[(Double, Int)]

    Return an array of features and indexes

    Return an array of features and indexes

    returns

    an array of turple2(value,index)

    Definition Classes
    SparseInstanceInstance
  16. def hadamard(input: Instance): SparseInstance

    Perform an element by element multiplication between two instances

    Perform an element by element multiplication between two instances

    input

    an Instance which is multiplied

    returns

    a SparseInstance representing the Hadamard product

    Definition Classes
    SparseInstanceInstance
  17. val inIndexes: Array[Int]

  18. val inValues: Array[Double]

  19. val indexes: Array[Int]

  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. def map(func: (Double) ⇒ Double): SparseInstance

    Apply an operation to every feature of the Instance (essentially a map)

    Apply an operation to every feature of the Instance (essentially a map)

    func

    the function for the transformation

    returns

    a new SparseInstance with the transformed features

    Definition Classes
    SparseInstanceInstance
  22. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  25. def reduce(func: (Double, Double) ⇒ Double): Double

    Aggregate the values of an instance

    Aggregate the values of an instance

    func

    the function for the transformation

    returns

    the aggregated value

    Definition Classes
    SparseInstanceInstance
  26. def set(index: Int, input: Double): SparseInstance

    Append a feature to the instance

    Append a feature to the instance

    index

    the index at which the value is added

    input

    the value which is added up

    returns

    a SparseInstance representing the new feature vector

    Definition Classes
    SparseInstanceInstance
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  28. def toString(): String

    Definition Classes
    SparseInstance → AnyRef → Any
  29. val values: Array[Double]

  30. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Product

Inherited from Equals

Inherited from Instance

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped