-
Notifications
You must be signed in to change notification settings - Fork 1
VITAL Documentation
We have developed VITAL, a python-based library for declaratively specifying VTA commands in Code Editor of Leam. We show several examples of VITAL here.
Dataset: data = VTA(“dataset-name.csv”)
Column: col = data.get_column(“text”)
Model: model = data.get_model(“model.h5”)
Visualization: vis = data.get_vis(0)
Rename column: data.rename(“old_column”, “new_column”)
Replace values: data.replace(“column_name”, old_value, new_value)
We now outline how to write various VTA operators in VITAL.
Project operation changes the dimensionality or cardinality of the input data.
Description: lowercases text in a column
Returns: None
Example: col.project().lowercase()
Mutate operation generates a new representation of the input data.
Description: creates a new column with # of words in column text
Returns: string name of new column
Example: col.mutate().num_words()
Description: creates a new column with sentiment values of column text
Returns: string name of new column
Example: col.mutate().sentiment()
Aggregate operation computes summary statistics of the input data.
Description: creates a dictionary of counts for each unique label in a column, stores the dictionary as unstructured metadata in Leam that can be used to make an aggregated visualization like a barchart or histogram
Returns: None
Example: col.aggregate().count(“label_counts_dict”)
Visualize operation creates a new visualization.
Description: creates a labeled barchart visualization from a dictionary of counts
Returns: None
Example: col.visualize(“barchart”, md_tag=“label_counts_dict”)
Note: md_tag means “metadata_tag” and is the name of the data that you store and can be used later to create a visualization, etc.
Description: creates a histogram visualization from columns
Returns: None
Example: data.visualize([“col1”, “col2”], “histogram”)
Description: adds a UDF (User-Defined Function) to VTA which can be called later on to create a metadata value
Returns: None
Example: data.add_udf(my_python_func)
Description: apply a UDF to create a new metadata value + store in Leam
Returns: None
Example: data.apply_udf(“my_python_func”, arg1, arg2, .., md_tag=”stored_value”)