17.2.13.1 別のデータベースでのモデルの埋込みの推測
ログインに使用したものとは異なるデータベースでトレーニング済モデルの埋込みを推測して格納できます。
次のコードは、別のデータベースで埋込みを推測して格納する方法を示しています。
opg-jshell> var vertexVectors = model.inferEmbeddings(fullGraph, testVertices).flattenAll()
opg-jshell> vertexVectors.write().
db().
username("user"). // DB user to use for storing the model
password("password"). // password of the DB user
jdbcUrl("jdbcUrl"). // jdbc url to the DB
name("vertex vectors").
tablename("vertexVectors"). // indicates the name of the table in which the data should be stored
overwrite(true).
store()
PgxFrame vertexVectors = model.inferEmbeddings(fullGraph,testVertices).flattenAll();
vertexVectors.write()
.db()
.username("user") // DB user to use for storing the model
.password("password") // password of the DB user
.jdbcUrl("jdbcUrl") // jdbc url to the DB
.name("vertex vectors")
.tablename("vertexVectors") // indicates the name of the table in which the data should be stored
.overwrite(true)
.store();
vertex_vectors = model.infer_embeddings(fullGraph,test_vertices).flattenAll()
vertex_vectors.write().db().username("user") \
.password("password") \
.jdbc_url("jdbcUrl") \
.table_name("table_name") \
.name("vertex vectors") \
.overwrite(True) \
.store()