8.1.9.1 別のデータベースからの事前トレーニング済モデルのロード
ログインに使用したものとは異なるデータベースからモデルをロードできます。
次のコードに示すように、事前トレーニング済モデルをデータベースのモデル・ストア表からロードできます。
JShellを使用した事前トレーニング済モデルのロード
opg4j> var model = analyst.<modelLoader>.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 modelstore("modeltablename"). // name of the model store table modelname("model"). // model name (primary key of model store table) load();
<modelLoader>は次のように適用されます。
loadDeepWalkModel(): DeepwalkモデルをロードloadSupervisedGraphWiseModel(): Supervised GraphWiseモデルをロードloadUnsupervisedGraphWiseModel(): Unsupervised GraphWiseモデルをロードloadPg2vecModel(): Pg2vecモデルをロード
Javaを使用した事前トレーニング済DeepWalkモデルのロード
<modeltype> model = analyst.<modelLoader>.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 .modelstore("modeltablename") // name of the model store table .modelname("model") // model name (primary key of model store table) .load();
<modeltype>には、ロードするモデルに基づいて次の値を指定できます。
DeepWalkModel: Deepwalkモデルを表します。SupervisedGraphWiseModel: Supervised GraphWiseモデルを表します。UnsupervisedGraphWiseModel: Unsupervised GraphWiseモデルを表します。Pg2vecModel: Pg2vecモデルを表します。
<modelLoader>は次のように適用されます。
loadDeepWalkModel(): DeepwalkモデルをロードloadSupervisedGraphWiseModel(): Supervised GraphWiseモデルをロードloadUnsupervisedGraphWiseModel(): Unsupervised GraphWiseモデルをロードloadPg2vecModel(): Pg2vecモデルをロード
Pythonを使用した事前トレーニング済DeepWalkモデルのロード
analyst.<modelLoader>.db(username="user",
password="password",
model_store="modelstoretablename",
model_name="model",
jdbc_url="jdbc_url")<modelLoader>は次のように適用されます。
get_deepwalk_model_loader(): Deepwalkモデルをロードget_supervised_graphwise_model_loader(): Supervised GraphWiseモデルをロードget_unsupervised_graphwise_model_loader(): Unsupervised GraphWiseモデルをロードget_pg2vec_model_loader(): Pg2vecモデルをロード
親トピック: 事前トレーニング済DeepWalkモデルのロード