The pyVIP client connects your Flow to Virtualitics Explore and the broader Virtualitics AI Platform, allowing the ability to engage with your visualizations and data within the full Virtualitics AI Platform.
Establishing a Connection with Explore
Option 1
If the run
function within your class is a child of the Step
class, add pyvip_client=None
.
class Graph(Step):
def run(self, flow_metadata, pyvip_client=None):
Option 2
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'])
Loading Data
If your data is to be loaded as a network graph:
pyvip_client.load_network(network_graph,
network_name = "Network Graph Results")
Otherwise, load your dataset into Explore:
pyvip_client.load_data(dataset, 'Dataset')
Preprocess your data:
pyvip_client.add_column(column, "Column Name")
Visualizing Data
Create a Scatter Plot
pyvip_client.plot(plot_type='scatter',
x='x_axis_name',
y='y_axis_name')
Build a Knowledge Graph
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)
Adding Annotations
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
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 Virtualitics Predict.
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 Virtualitics Explore API documentation at api.virtualitics.com.
Previous Article |
Next Article |