Whoops…Nothing found

Try other keywords in your search

How to Use the pyVIP (Virtualitics Explore) Client

 1 Minute

 0 Likes

 196 Views

When is this applicable?

The pyVIP client connects your Flow to Explore and the Virtualitics AI Platform, allowing the ability to engage with your visualizations and data within the Virtualitics AI Platform.

 

How-To:

  1. Establish a connection with Virtualitics Explore:
    1. Add pyvip_client=None to the run function within your class if it’s a child of the Step class 
class Graph(Step):
  def run(self, flow_metadata, pyvip_client=None):

b. If your class does not inherit from Step, then import PredictpyVIP and create a new pyVIP client  

from predict_backend.predict_pyvip.predict_pyvip import PredictpyVIP
class MyCustomEvent(CustomEvent):
  def callback(self, flow_metadata):
      store_interface = StoreInterface(**flow_metadata)
      pyvip_client = PredictpyVIP(user=flow_metadata['user'],
                                    flow_id=flow_metadata['flow_id'],
                                    step_name=flow_metadata['step_name'])

    2. Load your data:

        a. Load data into the Virtualitics AI Platform as a network graph:

pyvip_client.load_network(network_graph,
                          network_name = "Network Graph Results")
  1. Load dataset into Explore:
pyvip_client.load_data(dataset, 'Dataset')
  1. Preprocess your data:
pyvip_client.add_column(column, "Column Name")

    4. Visualize your data:

        a. Create a scatter plot:

pyvip_client.plot(plot_type='scatter', 
                  x='x_axis_name', 
                  y='y_axis_name')
  1. Build a knowledge graph:

- Add uses_pyvip=True to the command

from predict_backend.ml.nlp.flow.kg import ShowGraph

show_graph_step = ShowGraph(data_upload_step=data_upload_step,
                            pipeline_config_step=pipeline_config_step,
                            sim_thresh_step=sim_thresh_step,
                            advanced=False,
                            uses_pyvip=True)
  1. Add annotations to your visualization:
pyvip_client.create_annotation(
            vip_annotation.AnnotationType.DATASET,
            name = annotation_name,
            comment = annotation_comment,
            screenPositionX = 0.8,
            screenPositionY = 0.85,
            width = 0.2,
            height = 0.1)

 

What to Expect (Validation)

After running the Step in your Flow that has connected to the pyvip_client(), you should see the result (data manipulation, visualization, annotation, etc.) populate within the Virtualitics AI Platform.

Visualization in the Virtualitics AI Platform

 

Additional Details:

Any method that can called using the api.VIP() object in a Jupyter notebook can be called using the pyvip_client() object in the Virtualitics AI Platform. Here are example Jupyter Notebooks you can use for reference. Additionally, you can access the full Explore API documentation at api.virtualitics.com.

Was this article helpful?