DataFrameStatFunctions.SampleBy Method

Definition

Overloads

SampleBy<T>(Column, IDictionary<T,Double>, Int64)

Returns a stratified sample without replacement based on the fraction given on each stratum.

SampleBy<T>(String, IDictionary<T,Double>, Int64)

Returns a stratified sample without replacement based on the fraction given on each stratum.

SampleBy<T>(Column, IDictionary<T,Double>, Int64)

Returns a stratified sample without replacement based on the fraction given on each stratum.

[Microsoft.Spark.Since("3.0.0")]
public Microsoft.Spark.Sql.DataFrame SampleBy<T> (Microsoft.Spark.Sql.Column column, System.Collections.Generic.IDictionary<T,double> fractions, long seed);
[<Microsoft.Spark.Since("3.0.0")>]
member this.SampleBy : Microsoft.Spark.Sql.Column * System.Collections.Generic.IDictionary<'T, double> * int64 -> Microsoft.Spark.Sql.DataFrame
Public Function SampleBy(Of T) (column As Column, fractions As IDictionary(Of T, Double), seed As Long) As DataFrame

Type Parameters

T

Stratum type

Parameters

column
Column

Column that defines strata

fractions
IDictionary<T,Double>

Sampling fraction for each stratum. If a stratum is not specified, we treat its fraction as zero.

seed
Int64

Random seed

Returns

DataFrame object

Attributes

Applies to

SampleBy<T>(String, IDictionary<T,Double>, Int64)

Returns a stratified sample without replacement based on the fraction given on each stratum.

public Microsoft.Spark.Sql.DataFrame SampleBy<T> (string columnName, System.Collections.Generic.IDictionary<T,double> fractions, long seed);
member this.SampleBy : string * System.Collections.Generic.IDictionary<'T, double> * int64 -> Microsoft.Spark.Sql.DataFrame
Public Function SampleBy(Of T) (columnName As String, fractions As IDictionary(Of T, Double), seed As Long) As DataFrame

Type Parameters

T

Stratum type

Parameters

columnName
String

Column name that defines strata

fractions
IDictionary<T,Double>

Sampling fraction for each stratum. If a stratum is not specified, we treat its fraction as zero.

seed
Int64

Random seed

Returns

DataFrame object

Applies to