Packages

c

org.graphframes.convolutions

SamplingConvolution

class SamplingConvolution extends Serializable with Logging

A convolution operation on graph data that aggregates features from sampled neighbors using min-hash sampling with a seed.

For each vertex in the input GraphFrame, this class samples up to a maximum number of neighbors using a min-hash approach based on hashing the destination vertex IDs with a provided seed. The feature embeddings of these sampled neighbors are averaged, resulting in an aggregated neighbor embedding. Optionally, this aggregated embedding can be concatenated with the original vertex features to produce an updated feature vector.

The graph is expected to have a standard structure with ID columns in vertices and edges (via GraphFrame conventions).

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SamplingConvolution
  2. Logging
  3. Serializable
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new SamplingConvolution()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from SamplingConvolution toany2stringadd[SamplingConvolution] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (SamplingConvolution, B)
    Implicit
    This member is added by an implicit conversion from SamplingConvolution toArrowAssoc[SamplingConvolution] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  8. def ensuring(cond: (SamplingConvolution) => Boolean, msg: => Any): SamplingConvolution
    Implicit
    This member is added by an implicit conversion from SamplingConvolution toEnsuring[SamplingConvolution] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (SamplingConvolution) => Boolean): SamplingConvolution
    Implicit
    This member is added by an implicit conversion from SamplingConvolution toEnsuring[SamplingConvolution] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: => Any): SamplingConvolution
    Implicit
    This member is added by an implicit conversion from SamplingConvolution toEnsuring[SamplingConvolution] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): SamplingConvolution
    Implicit
    This member is added by an implicit conversion from SamplingConvolution toEnsuring[SamplingConvolution] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def logDebug(s: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  18. def logInfo(s: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  19. def logTrace(s: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  20. def logWarn(s: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  24. def onGraph(graph: GraphFrame): SamplingConvolution.this.type

    Specifies the GraphFrame to perform the convolution on.

    Specifies the GraphFrame to perform the convolution on.

    graph

    The input GraphFrame, which must contain vertices with an ID column and the features column as specified by setFeaturesCol. Feature columns should contain vector types (e.g., Vectors from MLlib).

    returns

    This SamplingConvolution instance for method chaining.

  25. def resultIsPersistent(): Unit
    Attributes
    protected
    Definition Classes
    Logging
  26. def run(): DataFrame

    Executes the sampling convolution operation and returns the resulting DataFrame.

    Executes the sampling convolution operation and returns the resulting DataFrame.

    The output DataFrame includes all original vertex columns. If concatEmbeddings is true, the features column is updated with the concatenated [original features, aggregated neighbor features]. If false, a new "nbr_embedding" column is added containing the aggregated neighbor features as a Vector.

    returns

    A DataFrame with the convoluted embeddings, retaining all original vertex columns plus modifications.

  27. def setConcatEmbeddings(value: Boolean): SamplingConvolution.this.type

    Sets whether to concatenate the aggregated neighbor features to the original vertex features.

    Sets whether to concatenate the aggregated neighbor features to the original vertex features.

    If true, the features column is updated by concatenating the aggregated neighbor embedding to the original features. If false, a new column "nbr_embedding" is added containing the aggregated neighbor features.

    value

    Boolean flag for concatenation.

    returns

    This SamplingConvolution instance for method chaining.

  28. def setFeaturesCol(value: String): SamplingConvolution.this.type

    Sets the name of the column in the vertices DataFrame containing the feature vectors.

    Sets the name of the column in the vertices DataFrame containing the feature vectors.

    value

    The string name of the column holding vertex embeddings as Vectors.

    returns

    This SamplingConvolution instance for method chaining.

  29. def setMaxNbrs(value: Int): SamplingConvolution.this.type

    Sets the maximum number of neighbors to sample per vertex.

    Sets the maximum number of neighbors to sample per vertex.

    value

    The maximum number of neighbors (integer) to select using min-hash sampling.

    returns

    This SamplingConvolution instance for method chaining.

  30. def setSeed(value: Long): SamplingConvolution.this.type

    Sets the seed for the random hash function used in min-hash sampling.

    Sets the seed for the random hash function used in min-hash sampling.

    value

    The long integer seed value for the xxhash64 hash function, ensuring reproducibility of sampling.

    returns

    This SamplingConvolution instance for method chaining.

  31. def setUseEdgeDirections(value: Boolean): SamplingConvolution.this.type

    Sets whether to use directed edge directions for neighbor sampling.

    Sets whether to use directed edge directions for neighbor sampling.

    If true, only outgoing edges are considered for sampling. If false, edges are treated as undirected, and both incoming and outgoing directions are included.

    value

    Boolean indicating whether to consider edge directions.

    returns

    This SamplingConvolution instance for method chaining.

  32. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

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

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from SamplingConvolution toStringFormat[SamplingConvolution] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (SamplingConvolution, B)
    Implicit
    This member is added by an implicit conversion from SamplingConvolution toArrowAssoc[SamplingConvolution] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from Logging

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromSamplingConvolution to any2stringadd[SamplingConvolution]

Inherited by implicit conversion StringFormat fromSamplingConvolution to StringFormat[SamplingConvolution]

Inherited by implicit conversion Ensuring fromSamplingConvolution to Ensuring[SamplingConvolution]

Inherited by implicit conversion ArrowAssoc fromSamplingConvolution to ArrowAssoc[SamplingConvolution]

Ungrouped