DataConversion

class DataConversion.DataConversion(col='', convertTo='', dateTimeFormat='yyyy-MM-dd HH:mm:ss')[source]

Bases: mmlspark.Utils.ComplexParamsMixin, pyspark.ml.util.JavaMLReadable, pyspark.ml.util.JavaMLWritable, pyspark.ml.wrapper.JavaTransformer

Converts the specified list of columns to the specified type. The types are specified by the following strings:

  • “boolean”
  • “byte”
  • “short”
  • “integer”
  • “long”
  • “float”
  • “double”
  • “string”
  • “toCategorical” - make the column be a categorical column
  • “clearCategorical” - clear the categorical column
  • “date” - the default date format is: “yyyy-MM-dd HH:mm:ss”
Parameters:
  • col (str) – Comma separated list of columns whose type will be converted (default: )
  • convertTo (str) – The result type (default: )
  • dateTimeFormat (str) – Format for DateTime when making DateTime:String conversions (default: yyyy-MM-dd HH:mm:ss)
getCol()[source]
Returns:Comma separated list of columns whose type will be converted (default: )
Return type:str
getConvertTo()[source]
Returns:The result type (default: )
Return type:str
getDateTimeFormat()[source]
Returns:Format for DateTime when making DateTime:String conversions (default: yyyy-MM-dd HH:mm:ss)
Return type:str
static getJavaPackage()[source]

Returns package name String.

classmethod read()[source]

Returns an MLReader instance for this class.

setCol(value)[source]
Parameters:col (str) – Comma separated list of columns whose type will be converted (default: )
setConvertTo(value)[source]
Parameters:convertTo (str) – The result type (default: )
setDateTimeFormat(value)[source]
Parameters:dateTimeFormat (str) – Format for DateTime when making DateTime:String conversions (default: yyyy-MM-dd HH:mm:ss)
setParams(col='', convertTo='', dateTimeFormat='yyyy-MM-dd HH:mm:ss')[source]

Set the (keyword only) parameters

Parameters:
  • col (str) – Comma separated list of columns whose type will be converted (default: )
  • convertTo (str) – The result type (default: )
  • dateTimeFormat (str) – Format for DateTime when making DateTime:String conversions (default: yyyy-MM-dd HH:mm:ss)