8.1.9.1 Loading a Pre-Trained Model From Another Database

You can load models from a different database other than the one used for login.

You can load a pre-trained model from a model store table in database as described in the following code:

Loading a Pre-Trained Model Using 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();
where <modelLoader> applies as follows:
  • loadDeepWalkModel(): Loads a Deepwalk model
  • loadSupervisedGraphWiseModel(): Loads a Supervised GraphWise model
  • loadUnsupervisedGraphWiseModel(): Loads a Unsupervised GraphWise model
  • loadPg2vecModel(): Loads a Pg2vec model
Loading a Pre-Trained DeepWalk Model Using Java
DeepWalkModelmodel = 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();
where <modelLoader> applies as follows:
  • loadDeepWalkModel(): Loads a Deepwalk model
  • loadSupervisedGraphWiseModel(): Loads a Supervised GraphWise model
  • loadUnsupervisedGraphWiseModel(): Loads a Unsupervised GraphWise model
  • loadPg2vecModel(): Loads a Pg2vec model
Loading a Pre-Trained DeepWalk Model Using Python
analyst.<modelLoader>.db(username="user",
                              password="password",
                              model_store="modelstoretablename",
                              model_name="model",
                              jdbc_url="jdbc_url")
where <modelLoader> applies as follows:
  • get_deepwalk_model_loader(): Loads a Deepwalk model
  • get_supervised_graphwise_model_loader(): Loads a Supervised GraphWise model
  • get_unsupervised_graphwise_model_loader(): Loads a Unsupervised GraphWise model
  • get_pg2vec_model_loader(): Loads a Pg2vec model