mmlspark.vw package

Submodules

mmlspark.vw.VectorZipper module

class mmlspark.vw.VectorZipper.VectorZipper(*args, **kwargs)[source]

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

Parameters
  • inputCols (list) – The names of the input columns

  • outputCol (str) – The name of the output column

getInputCols()[source]
Returns

The names of the input columns

Return type

list

static getJavaPackage()[source]

Returns package name String.

getOutputCol()[source]
Returns

The name of the output column

Return type

str

classmethod read()[source]

Returns an MLReader instance for this class.

setInputCols(value)[source]
Parameters

inputCols – The names of the input columns

setOutputCol(value)[source]
Parameters

outputCol – The name of the output column

setParams(inputCols=None, outputCol=None)[source]

Set the (keyword only) parameters

Parameters
  • inputCols (list) – The names of the input columns

  • outputCol (str) – The name of the output column

mmlspark.vw.VowpalWabbitClassifier module

class mmlspark.vw.VowpalWabbitClassifier.VowpalWabbitClassificationModel(java_model=None)[source]

Bases: mmlspark.vw._VowpalWabbitClassifier._VowpalWabbitClassificationModel

getNativeModel()[source]

Get the binary native VW model.

getPerformanceStatistics()[source]
getReadableModel()[source]
saveNativeModel(filename)[source]

Save the native model to a local or WASB remote location.

class mmlspark.vw.VowpalWabbitClassifier.VowpalWabbitClassifier(*args, **kwargs)[source]

Bases: mmlspark.vw._VowpalWabbitClassifier._VowpalWabbitClassifier

setInitialModel(model)[source]

Initialize the estimator with a previously trained model.

mmlspark.vw.VowpalWabbitContextualBandit module

class mmlspark.vw.VowpalWabbitContextualBandit.VowpalWabbitContextualBandit(*args, **kwargs)[source]

Bases: mmlspark.vw._VowpalWabbitContextualBandit._VowpalWabbitContextualBandit

parallelFit(dataset, param_maps)[source]
setInitialModel(model)[source]

Initialize the estimator with a previously trained model.

class mmlspark.vw.VowpalWabbitContextualBandit.VowpalWabbitContextualBanditModel(java_model=None)[source]

Bases: mmlspark.vw._VowpalWabbitContextualBandit._VowpalWabbitContextualBanditModel

getNativeModel()[source]

Get the binary native VW model.

getPerformanceStatistics()[source]
getReadableModel()[source]
saveNativeModel(filename)[source]

Save the native model to a local or WASB remote location.

mmlspark.vw.VowpalWabbitContextualBandit.to_java_params(sc, model, pyParamMap)[source]

mmlspark.vw.VowpalWabbitFeaturizer module

class mmlspark.vw.VowpalWabbitFeaturizer.VowpalWabbitFeaturizer(*args, **kwargs)[source]

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

Parameters
  • inputCols (list) – The names of the input columns (default: [Ljava.lang.String;@75da8bc6)

  • numBits (int) – Number of bits used to mask (default: 30)

  • outputCol (str) – The name of the output column (default: features)

  • prefixStringsWithColumnName (bool) – Prefix string features with column name (default: true)

  • preserveOrderNumBits (int) – Number of bits used to preserve the feature order. This will reduce the hash size. Needs to be large enough to fit count the maximum number of words (default: 0)

  • seed (int) – Hash seed (default: 0)

  • stringSplitInputCols (list) – Input cols that should be split at word boundaries (default: [Ljava.lang.String;@f5992bb)

  • sumCollisions (bool) – Sums collisions if true, otherwise removes them (default: true)

getInputCols()[source]
Returns

The names of the input columns (default: [Ljava.lang.String;@75da8bc6)

Return type

list

static getJavaPackage()[source]

Returns package name String.

getNumBits()[source]
Returns

Number of bits used to mask (default: 30)

Return type

int

getOutputCol()[source]
Returns

The name of the output column (default: features)

Return type

str

getPrefixStringsWithColumnName()[source]
Returns

Prefix string features with column name (default: true)

Return type

bool

getPreserveOrderNumBits()[source]
Returns

Number of bits used to preserve the feature order. This will reduce the hash size. Needs to be large enough to fit count the maximum number of words (default: 0)

Return type

int

getSeed()[source]
Returns

Hash seed (default: 0)

Return type

int

getStringSplitInputCols()[source]
Returns

Input cols that should be split at word boundaries (default: [Ljava.lang.String;@f5992bb)

Return type

list

getSumCollisions()[source]
Returns

Sums collisions if true, otherwise removes them (default: true)

Return type

bool

classmethod read()[source]

Returns an MLReader instance for this class.

setInputCols(value)[source]
Parameters

inputCols – The names of the input columns (default: [Ljava.lang.String;@75da8bc6)

setNumBits(value)[source]
Parameters

numBits – Number of bits used to mask (default: 30)

setOutputCol(value)[source]
Parameters

outputCol – The name of the output column (default: features)

setParams(inputCols=[], numBits=30, outputCol='features', prefixStringsWithColumnName=True, preserveOrderNumBits=0, seed=0, stringSplitInputCols=[], sumCollisions=True)[source]

Set the (keyword only) parameters

Parameters
  • inputCols (list) – The names of the input columns (default: [Ljava.lang.String;@75da8bc6)

  • numBits (int) – Number of bits used to mask (default: 30)

  • outputCol (str) – The name of the output column (default: features)

  • prefixStringsWithColumnName (bool) – Prefix string features with column name (default: true)

  • preserveOrderNumBits (int) – Number of bits used to preserve the feature order. This will reduce the hash size. Needs to be large enough to fit count the maximum number of words (default: 0)

  • seed (int) – Hash seed (default: 0)

  • stringSplitInputCols (list) – Input cols that should be split at word boundaries (default: [Ljava.lang.String;@f5992bb)

  • sumCollisions (bool) – Sums collisions if true, otherwise removes them (default: true)

setPrefixStringsWithColumnName(value)[source]
Parameters

prefixStringsWithColumnName – Prefix string features with column name (default: true)

setPreserveOrderNumBits(value)[source]
Parameters

preserveOrderNumBits – Number of bits used to preserve the feature order. This will reduce the hash size. Needs to be large enough to fit count the maximum number of words (default: 0)

setSeed(value)[source]
Parameters

seed – Hash seed (default: 0)

setStringSplitInputCols(value)[source]
Parameters

stringSplitInputCols – Input cols that should be split at word boundaries (default: [Ljava.lang.String;@f5992bb)

setSumCollisions(value)[source]
Parameters

sumCollisions – Sums collisions if true, otherwise removes them (default: true)

mmlspark.vw.VowpalWabbitInteractions module

class mmlspark.vw.VowpalWabbitInteractions.VowpalWabbitInteractions(*args, **kwargs)[source]

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

Parameters
  • inputCols (list) – The names of the input columns

  • numBits (int) – Number of bits used to mask (default: 30)

  • outputCol (str) – The name of the output column

  • sumCollisions (bool) – Sums collisions if true, otherwise removes them (default: true)

getInputCols()[source]
Returns

The names of the input columns

Return type

list

static getJavaPackage()[source]

Returns package name String.

getNumBits()[source]
Returns

Number of bits used to mask (default: 30)

Return type

int

getOutputCol()[source]
Returns

The name of the output column

Return type

str

getSumCollisions()[source]
Returns

Sums collisions if true, otherwise removes them (default: true)

Return type

bool

classmethod read()[source]

Returns an MLReader instance for this class.

setInputCols(value)[source]
Parameters

inputCols – The names of the input columns

setNumBits(value)[source]
Parameters

numBits – Number of bits used to mask (default: 30)

setOutputCol(value)[source]
Parameters

outputCol – The name of the output column

setParams(inputCols=None, numBits=30, outputCol=None, sumCollisions=True)[source]

Set the (keyword only) parameters

Parameters
  • inputCols (list) – The names of the input columns

  • numBits (int) – Number of bits used to mask (default: 30)

  • outputCol (str) – The name of the output column

  • sumCollisions (bool) – Sums collisions if true, otherwise removes them (default: true)

setSumCollisions(value)[source]
Parameters

sumCollisions – Sums collisions if true, otherwise removes them (default: true)

mmlspark.vw.VowpalWabbitRegressor module

class mmlspark.vw.VowpalWabbitRegressor.VowpalWabbitRegressionModel(java_model=None)[source]

Bases: mmlspark.vw._VowpalWabbitRegressor._VowpalWabbitRegressionModel

getNativeModel()[source]

Get the binary native VW model.

getPerformanceStatistics()[source]
getReadableModel()[source]
saveNativeModel(filename)[source]

Save the native model to a local or WASB remote location.

class mmlspark.vw.VowpalWabbitRegressor.VowpalWabbitRegressor(*args, **kwargs)[source]

Bases: mmlspark.vw._VowpalWabbitRegressor._VowpalWabbitRegressor

setInitialModel(model)[source]

Initialize the estimator with a previously trained model.

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.