17.1.10.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:
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 modelloadSupervisedGraphWiseModel(): Loads a Supervised GraphWise modelloadUnsupervisedGraphWiseModel(): Loads an Unsupervised GraphWise modelloadSupervisedEdgeWiseModel(): Loads a Supervised EdgeWise modelloadUnsupervisedEdgeWiseModel(): Loads an Unsupervised EdgeWise modelloadUnsupervisedAnomalyDetectionGraphWiseModel(): Loads an Unsupervised Anomaly Detection GraphWise modelloadPg2vecModel(): Loads a Pg2vec model
<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();where <modeltype> can have the following values based on the model to be loaded:
DeepWalkModel: represents a Deepwalk modelSupervisedGraphWiseModel: represents a Supervised GraphWise modelUnsupervisedGraphWiseModel: represents an Unsupervised GraphWise modelSupervisedEdgeWiseModel: represents a Supervised EdgeWise modelUnsupervisedEdgeWiseModel: represents an Unsupervised EdgeWise modelUnsupervisedAnomalyDetectionGraphWiseModel: represents an Unsupervised Anomaly Detection GraphWise modelPg2vecModel: represents a Pg2vec model
where <modelLoader> applies as follows:
loadDeepWalkModel(): Loads a Deepwalk modelloadSupervisedGraphWiseModel(): Loads a Supervised GraphWise modelloadUnsupervisedGraphWiseModel(): Loads an Unsupervised GraphWise modelloadSupervisedEdgeWiseModel(): Loads a Supervised EdgeWise modelloadUnsupervisedEdgeWiseModel(): Loads an Unsupervised EdgeWise modelloadUnsupervisedAnomalyDetectionGraphWiseModel(): Loads an Unsupervised Anomaly Detection GraphWise modelloadPg2vecModel(): Loads a Pg2vec model
model = analyst.<modelLoader>.db(model_store="modelstoretablename", # name of the model store table
model_name="model", # model name (primary key of model store table)
username="user", # DB user to use for storing the model
password="password", # password of the DB user
jdbc_url="jdbc_url") # jdbc url to the DB where <modelLoader> applies as follows:
get_deepwalk_model_loader(): Loads a Deepwalk modelget_supervised_graphwise_model_loader(): Loads a Supervised GraphWise modelget_unsupervised_graphwise_model_loader(): Loads an Unsupervised GraphWise modelget_supervised_edgewise_model_loader(): Loads a Supervised EdgeWise modelget_unsupervised_edgewise_model_loader(): Loads an Unsupervised EdgeWise modelget_unsupervised_anomaly_detection_graphwise_model_loader(): Loads an Unsupervised Anomaly Detection GraphWise modelget_pg2vec_model_loader(): Loads a Pg2vec model
Parent topic: Loading a Pre-Trained DeepWalk Model