DataConversion

class DataConversion.DataConversion(cols=None, 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:
  • cols (list) – Comma separated list of columns whose type will be converted
  • convertTo (str) – The result type (default: )
  • dateTimeFormat (str) – Format for DateTime when making DateTime:String conversions (default: yyyy-MM-dd HH:mm:ss)
getCols()[source]
Returns:Comma separated list of columns whose type will be converted
Return type:list
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.

setCols(value)[source]
Parameters:cols (list) – Comma separated list of columns whose type will be converted
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(cols=None, convertTo='', dateTimeFormat='yyyy-MM-dd HH:mm:ss')[source]

Set the (keyword only) parameters

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