mmlspark.image package

Submodules

mmlspark.image.ImageFeaturizer module

class mmlspark.image.ImageFeaturizer.ImageFeaturizer(cntkModel=None, cutOutputLayers=1, dropNa=True, inputCol=None, layerNames=None, outputCol=None)[source]

Bases: mmlspark.image._ImageFeaturizer._ImageFeaturizer

Parameters
  • SparkSession (SparkSession) – The SparkSession that will be used to find the model

  • ocation (str) – The location of the model, either on local or HDFS

setMiniBatchSize(size)[source]
setModel(modelSchema)[source]
setModelLocation(location)[source]

mmlspark.image.ImageSetAugmenter module

class mmlspark.image.ImageSetAugmenter.ImageSetAugmenter(flipLeftRight=True, flipUpDown=False, inputCol='image', outputCol=None)[source]

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

Parameters
  • flipLeftRight (bool) – Symmetric Left-Right (default: true)

  • flipUpDown (bool) – Symmetric Up-Down (default: false)

  • inputCol (str) – The name of the input column (default: image)

  • outputCol (str) – The name of the output column (default: [self.uid]_output)

getFlipLeftRight()[source]
Returns

Symmetric Left-Right (default: true)

Return type

bool

getFlipUpDown()[source]
Returns

Symmetric Up-Down (default: false)

Return type

bool

getInputCol()[source]
Returns

The name of the input column (default: image)

Return type

str

static getJavaPackage()[source]

Returns package name String.

getOutputCol()[source]
Returns

The name of the output column (default: [self.uid]_output)

Return type

str

classmethod read()[source]

Returns an MLReader instance for this class.

setFlipLeftRight(value)[source]
Parameters

flipLeftRight (bool) – Symmetric Left-Right (default: true)

setFlipUpDown(value)[source]
Parameters

flipUpDown (bool) – Symmetric Up-Down (default: false)

setInputCol(value)[source]
Parameters

inputCol (str) – The name of the input column (default: image)

setOutputCol(value)[source]
Parameters

outputCol (str) – The name of the output column (default: [self.uid]_output)

setParams(flipLeftRight=True, flipUpDown=False, inputCol='image', outputCol=None)[source]

Set the (keyword only) parameters

Parameters
  • flipLeftRight (bool) – Symmetric Left-Right (default: true)

  • flipUpDown (bool) – Symmetric Up-Down (default: false)

  • inputCol (str) – The name of the input column (default: image)

  • outputCol (str) – The name of the output column (default: [self.uid]_output)

mmlspark.image.UnrollBinaryImage module

class mmlspark.image.UnrollBinaryImage.UnrollBinaryImage(height=None, inputCol='image', nChannels=None, outputCol=None, width=None)[source]

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

Parameters
  • height (int) – the width of the image

  • inputCol (str) – The name of the input column (default: image)

  • nChannels (int) – the number of channels of the target image

  • outputCol (str) – The name of the output column (default: [self.uid]_output)

  • width (int) – the width of the image

getHeight()[source]
Returns

the width of the image

Return type

int

getInputCol()[source]
Returns

The name of the input column (default: image)

Return type

str

static getJavaPackage()[source]

Returns package name String.

getNChannels()[source]
Returns

the number of channels of the target image

Return type

int

getOutputCol()[source]
Returns

The name of the output column (default: [self.uid]_output)

Return type

str

getWidth()[source]
Returns

the width of the image

Return type

int

classmethod read()[source]

Returns an MLReader instance for this class.

setHeight(value)[source]
Parameters

height (int) – the width of the image

setInputCol(value)[source]
Parameters

inputCol (str) – The name of the input column (default: image)

setNChannels(value)[source]
Parameters

nChannels (int) – the number of channels of the target image

setOutputCol(value)[source]
Parameters

outputCol (str) – The name of the output column (default: [self.uid]_output)

setParams(height=None, inputCol='image', nChannels=None, outputCol=None, width=None)[source]

Set the (keyword only) parameters

Parameters
  • height (int) – the width of the image

  • inputCol (str) – The name of the input column (default: image)

  • nChannels (int) – the number of channels of the target image

  • outputCol (str) – The name of the output column (default: [self.uid]_output)

  • width (int) – the width of the image

setWidth(value)[source]
Parameters

width (int) – the width of the image

mmlspark.image.UnrollImage module

class mmlspark.image.UnrollImage.UnrollImage(inputCol='image', outputCol=None)[source]

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

Parameters
  • inputCol (str) – The name of the input column (default: image)

  • outputCol (str) – The name of the output column (default: [self.uid]_output)

getInputCol()[source]
Returns

The name of the input column (default: image)

Return type

str

static getJavaPackage()[source]

Returns package name String.

getOutputCol()[source]
Returns

The name of the output column (default: [self.uid]_output)

Return type

str

classmethod read()[source]

Returns an MLReader instance for this class.

setInputCol(value)[source]
Parameters

inputCol (str) – The name of the input column (default: image)

setOutputCol(value)[source]
Parameters

outputCol (str) – The name of the output column (default: [self.uid]_output)

setParams(inputCol='image', outputCol=None)[source]

Set the (keyword only) parameters

Parameters
  • inputCol (str) – The name of the input column (default: image)

  • outputCol (str) – The name of the output column (default: [self.uid]_output)

Module contents

MicrosoftML is a library of Python classes to interface with the Microsoft scala APIs to utilize Apache Spark to create distibuted machine learning models.

MicrosoftML simplifies training and scoring classifiers and regressors, as well as facilitating the creation of models using the CNTK library, images, and text.