Computation View
Experimental
The Workbench View classes are currently in experimental mode so have fun but expect issues and API changes going forward.
Note: This class can be automatically invoked from DataSource/FeatureSet set_computation_columns()
DataSource or FeatureSet. If you need more control then you can use this class directly.
ComputationView Class: Create a View with a subset of columns for display purposes
ComputationView
Bases: ColumnSubsetView
ComputationView Class: Create a View with a subset of columns for computation purposes
Common Usage
# Create a default ComputationView
fs = FeatureSet("test_features")
comp_view = ComputationView.create(fs)
df = comp_view.pull_dataframe()
# Create a ComputationView with a specific set of columns
comp_view = ComputationView.create(fs, column_list=["my_col1", "my_col2"])
# Query the view
df = comp_view.query(f"SELECT * FROM {comp_view.table} where prediction > 0.5")
Source code in src/workbench/core/views/computation_view.py
create(artifact, source_table=None, column_list=None, column_limit=30)
classmethod
Factory method to create and return a ComputationView instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
artifact
|
Union[DataSource, FeatureSet]
|
The DataSource or FeatureSet object |
required |
source_table
|
str
|
The table/view to create the view from. Defaults to None |
None
|
column_list
|
Union[list[str], None]
|
A list of columns to include. Defaults to None. |
None
|
column_limit
|
int
|
The max number of columns to include. Defaults to 30. |
30
|
Returns:
Type | Description |
---|---|
Union[View, None]
|
Union[View, None]: The created View object (or None if failed to create the view) |
Source code in src/workbench/core/views/computation_view.py
Questions?
The SuperCowPowers team is happy to answer any questions you may have about AWS and Workbench. Please contact us at workbench@supercowpowers.com or on chat us up on Discord