Virtualitics API Technical Overview
The Virtualitics API runs on a WebSocket connection between VIP (Server) and a Python session (Client). The Virtualitics API WebSocket is launched from VIP in the API section of the Preferences window. The Client WebSocket connection is established through the pyVIP package. The
api.VIP() constructor initializes this connection and creates a new
VIP object. This new
VIP object is a handler for the API connection and is used to communicate all API requests to the Python side.
The pyVIP package comes with two important classes. The first is the
VIP class, which is a handler for the API connection. The
VIP class contains methods for loading data, adding columns, generating visualizations, running VIP’s machine learning routines, and much more. There are several ways to generate new plots using the
VIP class. There is a generic
VIP.plot() method that allows the user to specify the plot type as a parameter. However, to take full advantage of specific settings for different plot types, we strongly recommend using the plot-type-specific methods (e.g.
VIP.surface(), etc.). When these methods finish generating the requested plot, they save a
VipPlot object to the
VIP.local_history, a list of these
VipPlot objects allow you to pass and update a set of mappings and settings within your own code. To generate the plot described in your
VipPlot object, simply call
VIP.show(VipPlot). By accessing the
VipPlot objects in the
VIP.local_history, you can make quick changes to plots you’ve recently generated.
Within your pandas DataFrame object, please ensure that the
dtype of your columns are either
object types. Additionally, our DataFrame parsers assume that your
object column contains only strings and will fail if you pass any other type of object.
If you choose to use the
category dtype provided by pandas, we recommend that you cast the data back to strings or otherwise convert to
int. We will work on adding a parser for the
category dtype to the API in a future release.
Filtering Data Points
To export a Boolean column describing which data points are currently visible in VIP, you can use the
vip.get_visible_points() command which will return a
pd.DataFrame instance. In this column, the
True values indicate the points which are currently visible.
We will be adding support to add/remove features to the Filter panel of VIP from the API in version 1.3.0 of VIP and pyVIP.