public class DeepWalkModelBuilder
extends java.lang.Object
Constructor and Description |
---|
DeepWalkModelBuilder(PgxSession session,
oracle.pgx.api.internal.Core core,
java.util.function.Supplier<java.lang.String> keystorePathSupplier,
java.util.function.Supplier<char[]> keystorePasswordSupplier)
Please do not use; only meant for being used by PGX itself.
|
Modifier and Type | Method and Description |
---|---|
DeepWalkModel |
build()
Builds the DeepWalk model with the builder configuration
|
int |
getBatchSize()
Gets the batch size for training the model (default: 128)
|
int |
getLayerSize()
Gets the number of dimensions for the output vectors (default: 200)
|
double |
getLearningRate()
Gets the initial learning rate (default: 0.025)
|
double |
getMinLearningRate()
Gets the minimum learning rate (default: 0.0001)
|
int |
getMinWordFrequency()
Gets the minimum word frequency to consider before pruning (default: 1)
|
int |
getNegativeSample()
Gets the number of negative samples (default: 10)
|
int |
getNumEpochs()
Gets the number of epochs to train the model (default: 2)
|
double |
getSampleRate()
Gets the sampling rate (default: 0.00001)
|
java.lang.Long |
getSeed()
Gets the random seed for training the model (default: null)
|
int |
getWalkLength()
Gets the length of the walks (default: 5)
|
int |
getWalksPerVertex()
Gets the number of walks to consider per vertex (default: 4)
|
int |
getWindowSize()
Gets the window size to consider while training the model (default: 5)
|
boolean |
isShuffle()
Gets whether the model will shuffle the shuffle the random walks before training on them
|
DeepWalkModelBuilder |
setBatchSize(int batchSize)
Sets the batch size for training the model (default: 128)
|
DeepWalkModelBuilder |
setIgnoreIsolated(boolean ignoreIsolated)
Whether to ignore isolated vertices.
|
DeepWalkModelBuilder |
setLayerSize(int layerSize)
Sets the number of dimensions for the output vectors (default: 200)
|
DeepWalkModelBuilder |
setLearningRate(double lr)
Sets the initial learning rate (default: 0.025)
|
DeepWalkModelBuilder |
setMinLearningRate(double minLr)
Sets the minimum learning rate (default: 0.0001)
|
DeepWalkModelBuilder |
setMinWordFrequency(int minWordFrequency)
Sets the minimum word frequency to consider before pruning (default: 1)
|
DeepWalkModelBuilder |
setNegativeSample(int negativeSample)
Sets the number of negative samples (default: 10)
|
DeepWalkModelBuilder |
setNumEpochs(int numEpochs)
Sets the number of epochs to train the model (default: 2)
|
DeepWalkModelBuilder |
setSampleRate(double sampleRate)
Sets the sample rate (default: 0.0)
Used to subsample frequent nodes.
|
DeepWalkModelBuilder |
setSeed(java.lang.Long seed)
Sets the random seed for training the model.
|
DeepWalkModelBuilder |
setShuffle(boolean shuffle)
Sets whether to shuffle the random walks before training on them
|
DeepWalkModelBuilder |
setWalkLength(int walkLength)
Sets the length of the walks (default: 5)
|
DeepWalkModelBuilder |
setWalksPerVertex(int walksPerVertex)
Sets the number of walks to consider per vertex (default: 4)
|
DeepWalkModelBuilder |
setWindowSize(int windowSize)
Sets the window size to consider while training the model (default: 5)
|
public DeepWalkModelBuilder(PgxSession session, oracle.pgx.api.internal.Core core, java.util.function.Supplier<java.lang.String> keystorePathSupplier, java.util.function.Supplier<char[]> keystorePasswordSupplier)
Analyst.deepWalkModelBuilder()
to get a model builder instead.session
- PgxSession to which the model is connectedcore
- Core to which the model is connectedpublic DeepWalkModel build() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public int getBatchSize()
public int getLayerSize()
public double getLearningRate()
public double getMinLearningRate()
public int getMinWordFrequency()
public int getNegativeSample()
public int getNumEpochs()
public double getSampleRate()
public java.lang.Long getSeed()
public int getWalkLength()
public int getWalksPerVertex()
public int getWindowSize()
public boolean isShuffle()
public DeepWalkModelBuilder setBatchSize(int batchSize)
batchSize
- batch size for training the modelpublic DeepWalkModelBuilder setIgnoreIsolated(boolean ignoreIsolated)
false
, pseudo-walks will consisting of only the node itself
will be inserted into the dataset (default: true).ignoreIsolated
- whether to ignorepublic DeepWalkModelBuilder setLayerSize(int layerSize)
layerSize
- number of dimensions for the output vectorspublic DeepWalkModelBuilder setLearningRate(double lr)
lr
- initial learning ratepublic DeepWalkModelBuilder setMinLearningRate(double minLr)
minLr
- minimum learning ratepublic DeepWalkModelBuilder setMinWordFrequency(int minWordFrequency)
minWordFrequency
- minimum word frequency to consider before pruningpublic DeepWalkModelBuilder setNegativeSample(int negativeSample)
negativeSample
- the number of negative samplespublic DeepWalkModelBuilder setNumEpochs(int numEpochs)
numEpochs
- number of epochs to train the modelpublic DeepWalkModelBuilder setSampleRate(double sampleRate)
sampleRate
- the sampling ratepublic DeepWalkModelBuilder setSeed(java.lang.Long seed)
Note that setting the seed will limit the amount of threads during the learning phase to 1
seed
- random seed for training the modelpublic DeepWalkModelBuilder setShuffle(boolean shuffle)
shuffle
- whether to shufflepublic DeepWalkModelBuilder setWalkLength(int walkLength)
walkLength
- length of the walkspublic DeepWalkModelBuilder setWalksPerVertex(int walksPerVertex)
walksPerVertex
- number of walks to consider per vertexpublic DeepWalkModelBuilder setWindowSize(int windowSize)
windowSize
- window size to consider while training the model