sparseEncoder

fun sparseEncoder(schema: StructType, vararg columns: String): SparseEncoder(source)

Encodes numeric and categorical features into sparse array with one-hot encoding of categorical variables.

Return

the SparseEncoder.

Parameters

schema

the data frame schema.

columns

the column names to encode. If empty, all numeric and categorical columns will be used.


fun DataFrame.sparseEncoder(vararg columns: String): SparseEncoder(source)

Creates a sparse encoder for this DataFrame.

Return

the SparseEncoder.

Parameters

columns

the column names to encode. If empty, all numeric and categorical columns will be used.