TypeConverters

class pyspark.ml.param.TypeConverters[source]

Factory methods for common type conversion functions for Param.typeConverter.

New in version 2.0.0.

Methods

identity(value)

Dummy converter that just returns value.

toBoolean(value)

Convert a value to a boolean, if possible.

toFloat(value)

Convert a value to a float, if possible.

toInt(value)

Convert a value to an int, if possible.

toList(value)

Convert a value to a list, if possible.

toListFloat(value)

Convert a value to list of floats, if possible.

toListInt(value)

Convert a value to list of ints, if possible.

toListListFloat(value)

Convert a value to list of list of floats, if possible.

toListString(value)

Convert a value to list of strings, if possible.

toMatrix(value)

Convert a value to a MLlib Matrix, if possible.

toString(value)

Convert a value to a string, if possible.

toVector(value)

Convert a value to a MLlib Vector, if possible.

Methods Documentation

static identity(value: T) → T[source]

Dummy converter that just returns value.

static toBoolean(value: Any) → bool[source]

Convert a value to a boolean, if possible.

static toFloat(value: Any) → float[source]

Convert a value to a float, if possible.

static toInt(value: Any) → int[source]

Convert a value to an int, if possible.

static toList(value: Any) → List[source]

Convert a value to a list, if possible.

static toListFloat(value: Any) → List[float][source]

Convert a value to list of floats, if possible.

static toListInt(value: Any) → List[int][source]

Convert a value to list of ints, if possible.

static toListListFloat(value: Any) → List[List[float]][source]

Convert a value to list of list of floats, if possible.

static toListString(value: Any) → List[str][source]

Convert a value to list of strings, if possible.

static toMatrix(value: Any)pyspark.ml.linalg.Matrix[source]

Convert a value to a MLlib Matrix, if possible.

static toString(value: Any) → str[source]

Convert a value to a string, if possible.

static toVector(value: Any)pyspark.ml.linalg.Vector[source]

Convert a value to a MLlib Vector, if possible.