public class Pg2vecModelBuilder
extends java.lang.Object
Constructor and Description |
---|
Pg2vecModelBuilder(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 |
---|---|
Pg2vecModel |
build()
Builds the Pg2vec Model with the builder configuration
|
int |
getBatchSize()
Gets the batch size for training the model (default: 128)
|
java.lang.String |
getGraphLetIdPropertyName()
Gets the property name of the graphlet-id in the input graph
|
java.lang.String |
getGraphletSizePropertyName()
Gets the property name for graphlet size (default: "graphletSize-Pg2vec")
|
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 |
getNumEpochs()
Gets the number of epochs to train the model (default: 2)
|
java.lang.Long |
getSeed()
Gets the random seed for training the model (default: null)
|
java.lang.Boolean |
getUseGraphletSize()
Gets whether to use or not the graphlet size (default: true)
|
double |
getValidationFraction()
Gets the fraction of training data on which to compute final loss (default: 0.05)
|
java.util.Collection<java.lang.String> |
getVertexPropertyNames()
Gets the property names to consider for pg2vec model training
|
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
|
Pg2vecModelBuilder |
setBatchSize(int batchSize)
Sets the batch size for training the model (default: 128)
|
Pg2vecModelBuilder |
setGraphLetIdPropertyName(java.lang.String graphLetIdName)
Sets the property name of the graphlet-id in the input graph (required input)
|
Pg2vecModelBuilder |
setGraphletSizePropertyName(java.lang.String graphletSizePropertyName)
Sets the property name for graphlet size (default: "graphletSize-Pg2vec")
|
Pg2vecModelBuilder |
setLayerSize(int layerSize)
Sets the number of dimensions for the output vectors (default: 200)
|
Pg2vecModelBuilder |
setLearningRate(double lr)
Sets the initial learning rate (default: 0.025)
|
Pg2vecModelBuilder |
setMinLearningRate(double minLr)
Sets the minimum learning rate (default: 0.0001)
|
Pg2vecModelBuilder |
setMinWordFrequency(int minWordFrequency)
Sets the minimum word frequency to consider before pruning (default: 1)
|
Pg2vecModelBuilder |
setNumEpochs(int numEpochs)
Sets the number of epochs to train the model (default: 2)
|
Pg2vecModelBuilder |
setSeed(java.lang.Long seed)
Sets the random seed for training the model.
|
Pg2vecModelBuilder |
setShuffle(boolean shuffle)
Sets whether to shuffle the random walks before training on them
|
Pg2vecModelBuilder |
setUseGraphletSize(java.lang.Boolean useGraphletSize)
Sets whether to use or not the graphlet size (default: true)
|
Pg2vecModelBuilder |
setValidationFraction(double validationFraction)
Sets the fraction of training data on which to compute final loss (default: 0.05)
|
Pg2vecModelBuilder |
setVertexPropertyNames(java.util.Collection<java.lang.String> vertexPropertyNames)
Sets the property names to consider for pg2vec model training (required input)
|
Pg2vecModelBuilder |
setWalkLength(int walkLength)
Sets the length of the walks (default: 5)
|
Pg2vecModelBuilder |
setWalksPerVertex(int walksPerVertex)
Sets the number of walks to consider per vertex (default: 4)
|
Pg2vecModelBuilder |
setWindowSize(int windowSize)
Sets the window size to consider while training the model (default: 5)
|
public Pg2vecModelBuilder(PgxSession session, oracle.pgx.api.internal.Core core, java.util.function.Supplier<java.lang.String> keystorePathSupplier, java.util.function.Supplier<char[]> keystorePasswordSupplier)
Analyst.pg2vecModelBuilder()
to get a model builder instead.session
- PgxSession to which the model is connectedcore
- Core to which the model is connectedpublic Pg2vecModel build() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public int getBatchSize()
public java.lang.String getGraphLetIdPropertyName()
public java.lang.String getGraphletSizePropertyName()
public int getLayerSize()
public double getLearningRate()
public double getMinLearningRate()
public int getMinWordFrequency()
public int getNumEpochs()
public java.lang.Long getSeed()
public java.lang.Boolean getUseGraphletSize()
public double getValidationFraction()
public java.util.Collection<java.lang.String> getVertexPropertyNames()
public int getWalkLength()
public int getWalksPerVertex()
public int getWindowSize()
public boolean isShuffle()
public Pg2vecModelBuilder setBatchSize(int batchSize)
batchSize
- batch size for training the modelpublic Pg2vecModelBuilder setGraphLetIdPropertyName(java.lang.String graphLetIdName)
graphLetIdName
- property name of the graphlet-id in the input graphpublic Pg2vecModelBuilder setGraphletSizePropertyName(java.lang.String graphletSizePropertyName)
public Pg2vecModelBuilder setLayerSize(int layerSize)
layerSize
- number of dimensions for the output vectorspublic Pg2vecModelBuilder setLearningRate(double lr)
lr
- initial learning ratepublic Pg2vecModelBuilder setMinLearningRate(double minLr)
minLr
- minimum learning ratepublic Pg2vecModelBuilder setMinWordFrequency(int minWordFrequency)
minWordFrequency
- minimum word frequency to consider before pruningpublic Pg2vecModelBuilder setNumEpochs(int numEpochs)
numEpochs
- number of epochs to train the modelpublic Pg2vecModelBuilder 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 Pg2vecModelBuilder setShuffle(boolean shuffle)
shuffle
- whether to shufflepublic Pg2vecModelBuilder setUseGraphletSize(java.lang.Boolean useGraphletSize)
useGraphletSize
- to use or not the graphlet size (default: true)public Pg2vecModelBuilder setValidationFraction(double validationFraction)
validationFraction
- fraction of training data on which to compute final losspublic Pg2vecModelBuilder setVertexPropertyNames(java.util.Collection<java.lang.String> vertexPropertyNames)
vertexPropertyNames
- property names to consider for pg2vec model trainingpublic Pg2vecModelBuilder setWalkLength(int walkLength)
walkLength
- length of the walkspublic Pg2vecModelBuilder setWalksPerVertex(int walksPerVertex)
walksPerVertex
- number of walks to consider per vertexpublic Pg2vecModelBuilder setWindowSize(int windowSize)
windowSize
- window size to consider while training the model