public class Pg2vecModel extends Model<Pg2vecModel>
Constructor and Description |
---|
Pg2vecModel(PgxSession session, oracle.pgx.api.internal.Core core, java.util.function.Supplier<java.lang.String> keystorePathSupplier, java.util.function.Supplier<char[]> keystorePasswordSupplier, oracle.pgx.api.internal.mllib.ModelMetadata modelMetadata) |
Pg2vecModel(PgxSession session, oracle.pgx.api.internal.Core core, java.util.function.Supplier<java.lang.String> keystorePathSupplier, java.util.function.Supplier<char[]> keystorePasswordSupplier, oracle.pgx.api.internal.mllib.Pg2vecModelMetadata modelMetadata)
Please do not use; only meant for being used by PGX itself.
|
Modifier and Type | Method and Description |
---|---|
PgxFrame |
computeSimilars(java.util.List<java.lang.Object> graphletIds, int k)
Blocking version of
computeSimilarsAsync(List, int) . |
PgxFrame |
computeSimilars(java.lang.Object graphletId, int k)
Blocking version of
computeSimilarsAsync(Object, int) . |
PgxFuture<PgxFrame> |
computeSimilarsAsync(java.util.List<java.lang.Object> graphletIdObjects, int k)
Computes the top-k similar graphlets for a list of input graphlets
|
PgxFuture<PgxFrame> |
computeSimilarsAsync(java.lang.Object graphletIdObject, int k)
Computes the top-k similar graphlets for a given graphlet
|
void |
destroy()
Blocking version of
destroyAsync() . |
PgxFuture<java.lang.Void> |
destroyAsync()
Destroys a pre-trained Pg2vec model
|
void |
fit(PgxGraph graph)
Blocking version of
fitAsync(PgxGraph) . |
PgxFuture<java.lang.Void> |
fitAsync(PgxGraph graph)
Trains the Pg2vec model on the input graph
|
int |
getBatchSize()
Gets the batch size of the model
|
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 component size (used by default)
|
int |
getLayerSize()
Gets the number of dimensions for the output vectors
|
double |
getLearningRate()
Gets the initial learning rate
|
double |
getLoss()
Gets the loss value during training
|
double |
getMinLearningRate()
Gets the minimum learning rate
|
int |
getMinWordFrequency()
Gets the minimum word frequency to consider before pruning
|
int |
getNumEpochs()
Gets the number of epochs to train the model
|
double |
getSeed()
Gets the random seed
|
PgxFrame |
getTrainedGraphletVectors()
Blocking version of
getTrainedGraphletVectorsAsync() . |
PgxFuture<PgxFrame> |
getTrainedGraphletVectorsAsync()
Gets the trained graphlet vectors for the current pg2vec model
|
java.lang.Boolean |
getUseGraphletSize()
Gets whether the model uses the graphlet size
|
double |
getValidationFraction()
Gets the fraction of the training data used to compute the loss value
|
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
|
int |
getWalksPerVertex()
Gets the number of walks to consider per vertex
|
int |
getWindowSize()
Gets the window size to consider while training the model
|
PgxFrame |
inferGraphletVector(PgxGraph graph)
Blocking version of
inferGraphletVectorAsync(PgxGraph) . |
PgxFuture<PgxFrame> |
inferGraphletVectorAsync(PgxGraph graph)
Infers the vector of the input graphlet
|
PgxFrame |
inferGraphletVectorBatched(PgxGraph graph)
Blocking version of
inferGraphletVectorBatchedAsync(PgxGraph) . |
PgxFuture<PgxFrame> |
inferGraphletVectorBatchedAsync(PgxGraph graph)
Infers the vectors of the input graphlets
|
void |
store(java.lang.String path, java.lang.String key)
Blocking version of
storeAsync(String, String) . |
void |
store(java.lang.String path, java.lang.String key, boolean overwrite)
Blocking version of
storeAsync(String, String) . |
PgxFuture<java.lang.Void> |
storeAsync(java.lang.String path, java.lang.String key)
Stores the Pg2vec model in the specified path, with encryption.
|
PgxFuture<java.lang.Void> |
storeAsync(java.lang.String path, java.lang.String key, boolean overwrite)
Stores the Pg2vec model in the specified path, with encryption.
|
public Pg2vecModel(PgxSession session, oracle.pgx.api.internal.Core core, java.util.function.Supplier<java.lang.String> keystorePathSupplier, java.util.function.Supplier<char[]> keystorePasswordSupplier, oracle.pgx.api.internal.mllib.ModelMetadata modelMetadata)
public Pg2vecModel(PgxSession session, oracle.pgx.api.internal.Core core, java.util.function.Supplier<java.lang.String> keystorePathSupplier, java.util.function.Supplier<char[]> keystorePasswordSupplier, oracle.pgx.api.internal.mllib.Pg2vecModelMetadata modelMetadata)
Analyst.pg2vecModelBuilder()
to get a model builder and then create a model, or load a model with oracle.pgx.api.Analyst#loadPg2vecModel(String)
.session
- PgxSession to which the model is connectedcore
- Core to which the model is connectedmodelMetadata
- Metadata concerning the different hyper-parameters of the Pg2vec Modelpublic PgxFrame computeSimilars(java.util.List<java.lang.Object> graphletIds, int k) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
computeSimilarsAsync(List, int)
. Calls computeSimilarsAsync(List, int)
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.public PgxFrame computeSimilars(java.lang.Object graphletId, int k) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
computeSimilarsAsync(Object, int)
. Calls computeSimilarsAsync(Object, int)
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.public PgxFuture<PgxFrame> computeSimilarsAsync(java.util.List<java.lang.Object> graphletIdObjects, int k)
graphletIdObjects
- list of ids of graphlets for which to compute the similar graphletsk
- number of similars to returnpublic PgxFuture<PgxFrame> computeSimilarsAsync(java.lang.Object graphletIdObject, int k)
graphletIdObject
- id of the graphlet for which to compute the similar graphletsk
- number of similars to returnpublic void destroy() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
destroyAsync()
. Calls destroyAsync()
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.public PgxFuture<java.lang.Void> destroyAsync()
destroyAsync
in class Model<Pg2vecModel>
public void fit(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
fitAsync(PgxGraph)
. Calls fitAsync(PgxGraph)
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.public PgxFuture<java.lang.Void> fitAsync(PgxGraph graph)
graph
- input graph to fit onpublic int getBatchSize()
public java.lang.String getGraphLetIdPropertyName()
public java.lang.String getGraphletSizePropertyName()
public int getLayerSize()
public double getLearningRate()
public double getLoss()
public double getMinLearningRate()
public int getMinWordFrequency()
public int getNumEpochs()
public double getSeed()
public PgxFrame getTrainedGraphletVectors() throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
getTrainedGraphletVectorsAsync()
. Calls getTrainedGraphletVectorsAsync()
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.public PgxFuture<PgxFrame> getTrainedGraphletVectorsAsync()
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 PgxFrame inferGraphletVector(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
inferGraphletVectorAsync(PgxGraph)
. Calls inferGraphletVectorAsync(PgxGraph)
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.public PgxFuture<PgxFrame> inferGraphletVectorAsync(PgxGraph graph)
graph
- graphlet for which to infer a vectorpublic PgxFrame inferGraphletVectorBatched(PgxGraph graph) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
inferGraphletVectorBatchedAsync(PgxGraph)
. Calls inferGraphletVectorBatchedAsync(PgxGraph)
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.public PgxFuture<PgxFrame> inferGraphletVectorBatchedAsync(PgxGraph graph)
graph
- graphlets (as a single graph but different graphlet-id) for which to infer vectorspublic void store(java.lang.String path, java.lang.String key) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
storeAsync(String, String)
. Calls storeAsync(String, String)
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.public void store(java.lang.String path, java.lang.String key, boolean overwrite) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
storeAsync(String, String)
. Calls storeAsync(String, String)
and waits for the returned PgxFuture
to complete.java.lang.InterruptedException
- if the caller thread gets interrupted while waiting for completion.java.util.concurrent.ExecutionException
- if any exception occurred during asynchronous execution. The actual exception will be nested.public PgxFuture<java.lang.Void> storeAsync(java.lang.String path, java.lang.String key)
path
- path to store the modelkey
- the encryption key, or null if no encryption should be used.public PgxFuture<java.lang.Void> storeAsync(java.lang.String path, java.lang.String key, boolean overwrite)
path
- path to store the modelkey
- the encryption key, or null if no encryption should be used.