Class: Word2VecModel

eclairjs/ml/feature. Word2VecModel

Extends

Methods

(static) load(path) → {module:eclairjs/ml/feature.Word2VecModel}

Parameters:
Name Type Description
path string
Source:
Returns:
Type
module:eclairjs/ml/feature.Word2VecModel

(static) read() → {module:eclairjs/ml/util.MLReader}

Source:
Returns:
Type
module:eclairjs/ml/util.MLReader

copy(extra) → {module:eclairjs/ml/feature.Word2VecModel}

Creates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly.
Parameters:
Name Type Description
extra module:eclairjs/ml/param.ParamMap
Overrides:
Source:
Returns:
Type
module:eclairjs/ml/feature.Word2VecModel

findSynonyms(word, num) → {module:eclairjs/sql.Dataset}

Find "num" number of words closest in similarity to the given word or vector representation. Returns a Dataset with the words and the cosine similarities between the synonyms and the given word.
Parameters:
Name Type Description
word string | module:eclairjs/mllib/linalg.Vector
num integer
Source:
Returns:
Type
module:eclairjs/sql.Dataset

getInputCol() → {string}

Source:
Returns:
Type
string

getMaxIter() → {integer}

Source:
Returns:
Type
integer

getMinCount() → {integer}

Source:
Returns:
Type
integer

getNumPartitions() → {integer}

Source:
Returns:
Type
integer

getOutputCol() → {string}

Source:
Returns:
Type
string

getSeed() → {integer}

Source:
Returns:
Type
integer

getStepSize() → {float}

Source:
Returns:
Type
float

getVectors() → {module:eclairjs/sql.Dataset}

Returns a Dataset with two fields, "word" and "vector", with "word" being a String and and the vector the DenseVector that it is mapped to.
Source:
Returns:
Type
module:eclairjs/sql.Dataset

getVectorSize() → {integer}

Source:
Returns:
Type
integer

getWindowSize() → {integer}

Source:
Returns:
Type
integer

hasParent() → {boolean}

Inherited From:
Source:
Returns:
Type
boolean

inputCol() → {module:eclairjs/ml/param.Param}

Source:
Returns:
Type
module:eclairjs/ml/param.Param

maxIter() → {module:eclairjs/ml/param.IntParam}

Param for maximum number of iterations (>= 0).
Source:
Returns:
Type
module:eclairjs/ml/param.IntParam

minCount() → {module:eclairjs/ml/param.IntParam}

The minimum number of times a token must appear to be included in the word2vec model's vocabulary. Default: 5
Source:
Returns:
Type
module:eclairjs/ml/param.IntParam

numPartitions() → {module:eclairjs/ml/param.IntParam}

Number of partitions for sentences of words. Default: 1
Source:
Returns:
Type
module:eclairjs/ml/param.IntParam

outputCol() → {module:eclairjs/ml/param.Param}

Source:
Returns:
Type
module:eclairjs/ml/param.Param

parent() → {module:eclairjs/ml.Estimator}

Inherited From:
Source:
Returns:
Type
module:eclairjs/ml.Estimator

seed() → {module:eclairjs/ml/param.LongParam}

Param for random seed.
Source:
Returns:
Type
module:eclairjs/ml/param.LongParam

setInputCol(value) → {module:eclairjs/ml/feature.Word2VecModel}

Parameters:
Name Type Description
value string
Source:
Returns:
Type
module:eclairjs/ml/feature.Word2VecModel

setOutputCol(value) → {module:eclairjs/ml/feature.Word2VecModel}

Parameters:
Name Type Description
value string
Source:
Returns:
Type
module:eclairjs/ml/feature.Word2VecModel

setParent(parent) → {object}

Sets the parent of this model.
Parameters:
Name Type Description
parent module:eclairjs/ml.Estimator
Inherited From:
Source:
Returns:
Type
object

stepSize() → {module:eclairjs/ml/param.DoubleParam}

Param for Step size to be used for each iteration of optimization
Source:
Returns:
Type
module:eclairjs/ml/param.DoubleParam

transform(dataset) → {module:eclairjs/sql.Dataset}

Transform a sentence column to a vector column to represent the whole sentence. The transform is performed by averaging all word vectors it contains.
Parameters:
Name Type Description
dataset module:eclairjs/sql.Dataset
Overrides:
Source:
Returns:
Type
module:eclairjs/sql.Dataset

transformSchema(schema) → {module:eclairjs/sql/types.StructType}

Derives the output schema from the input schema.
Parameters:
Name Type Description
schema module:eclairjs/sql/types.StructType
Overrides:
Source:
Returns:
Type
module:eclairjs/sql/types.StructType

uid() → {string}

An immutable unique ID for the object and its derivatives.
Source:
Returns:
Type
string

validateAndTransformSchema(schema) → {module:eclairjs/sql/types.StructType}

Validates and transforms the input schema.
Parameters:
Name Type Description
schema module:eclairjs/sql/types.StructType
Source:
Returns:
Type
module:eclairjs/sql/types.StructType

vectorSize() → {module:eclairjs/ml/param.IntParam}

The dimension of the code that you want to transform from words. Default: 100
Source:
Returns:
Type
module:eclairjs/ml/param.IntParam

windowSize() → {module:eclairjs/ml/param.IntParam}

The window size (context words from [-window, window]) default 5.
Source:
Returns:
Type
module:eclairjs/ml/param.IntParam

write() → {module:eclairjs/ml/util.MLWriter}

Source:
Returns:
Type
module:eclairjs/ml/util.MLWriter