Training View
Experimental
The Workbench View classes are currently in experimental mode so have fun but expect issues and API changes going forward.
TrainingView Class: A View with an additional training column that marks holdout ids
TrainingView
Bases: CreateView
TrainingView Class: A View with an additional training column that marks holdout ids
Common Usage
# Create a default TrainingView
fs = FeatureSet("test_features")
training_view = TrainingView.create(fs)
df = training_view.pull_dataframe()
# Create a TrainingView with a specific set of columns
training_view = TrainingView.create(fs, column_list=["my_col1", "my_col2"])
# Query the view
df = training_view.query(f"SELECT * FROM {training_view.table} where training = TRUE")
Source code in src/workbench/core/views/training_view.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
create(feature_set, source_table=None, id_column=None, holdout_ids=None)
classmethod
Factory method to create and return a TrainingView instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
feature_set
|
FeatureSet
|
A FeatureSet object |
required |
source_table
|
str
|
The table/view to create the view from. Defaults to None. |
None
|
id_column
|
str
|
The name of the id column. Defaults to None. |
None
|
holdout_ids
|
Union[list[str], list[int], None]
|
A list of holdout ids. Defaults to None. |
None
|
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/training_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