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).
- Alphabetic
- By Inheritance
- SamplingConvolution
- Logging
- Serializable
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new SamplingConvolution()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- 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
- 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()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- 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
- 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
- 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
- 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
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logDebug(s: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(s: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(s: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarn(s: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- 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.
- def resultIsPersistent(): Unit
- Attributes
- protected
- Definition Classes
- Logging
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- 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 ofvalue.formatted(formatString), or use thef""string interpolator. In Java 15 and later,formattedresolves to the new method in String which has reversed parameters.
- 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.