Datasets
Dataset ¶
Dataset(
type,
name=None,
resource=None,
training_resource=None,
testing_resource=None,
validation_resource=None,
derived_from=None,
dataframe=None,
training_dataframe=None,
testing_dataframe=None,
validation_dataframe=None,
)
Users should not instantiate a dataset directly but rather use the provided static methods
origin()
,
clean()
, and
modeling()
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type |
DatasetType
|
The type of dataset. |
required |
name |
str | None
|
The name of the dataset. |
None
|
resource |
Resource | None
|
A single resource (for origin and clean datasets). |
None
|
training_resource |
Resource | None
|
The resource for the training set (for modeling datasets). |
None
|
testing_resource |
Resource | None
|
The resource for the testing set (for modeling datasets). |
None
|
validation_resource |
Resource | None
|
The resource for the validation set (optional, for modeling datasets). |
None
|
derived_from |
list[int | Dataset] | None
|
A list of datasets (or ids) from which this dataset is derived. |
None
|
dataframe |
DataFrame | None
|
A pandas dataframe for clean and origin datasets. |
None
|
training_dataframe |
DataFrame | None
|
A pandas dataframe for modeling dataset. |
None
|
testing_dataframe |
DataFrame | None
|
A pandas dataframe for modeling dataset. |
None
|
validation_dataframe |
DataFrame | None
|
A pandas dataframe for modeling dataset. |
None
|
Source code in src/vectice/models/dataset.py
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 |
|
derived_from
property
¶
derived_from: list[int]
latest_version_id
writable
property
¶
latest_version_id: int | None
The id of the latest version of this dataset.
Returns:
Type | Description |
---|---|
int | None
|
The id of the latest version of this dataset. |
name
writable
property
¶
name: str
resource
property
¶
resource: Resource | tuple[
Resource, Resource, Resource | None
]
type
property
¶
type: DatasetType
clean
staticmethod
¶
clean(
resource, name=None, derived_from=None, dataframe=None
)
Create a clean dataset.
Examples:
from vectice import Dataset, FileResource
dataset = Dataset.clean(
name="my clean dataset",
resource=FileResource(path="clean_dataset.csv"),
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource |
Resource
|
The resource for the clean dataset. |
required |
name |
str | None
|
The name of the dataset. |
None
|
derived_from |
list[int | Dataset] | None
|
A list of datasets (or ids) from which this dataset is derived. |
None
|
dataframe |
DataFrame | None
|
A pandas dataframe allowing vectice to compute more metadata about this dataset. |
None
|
Source code in src/vectice/models/dataset.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
modeling
staticmethod
¶
modeling(
training_resource,
testing_resource,
validation_resource=None,
name=None,
training_dataframe=None,
testing_dataframe=None,
validation_dataframe=None,
)
Create a modeling dataset.
Examples:
from vectice import Dataset, FileResource
dataset = Dataset.modeling(
name="my modeling dataset",
training_resource=FileResource(path="training_dataset.csv"),
testing_resource=FileResource(path="testing_dataset.csv"),
validation_resource=FileResource(path="validation_dataset.csv"),
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
training_resource |
Resource
|
The resource for the training set (for modeling datasets). |
required |
testing_resource |
Resource
|
The resource for the testing set (for modeling datasets). |
required |
validation_resource |
Resource | None
|
The resource for the validation set (optional, for modeling datasets). |
None
|
name |
str | None
|
The name of the dataset. |
None
|
training_dataframe |
DataFrame | None
|
A pandas dataframe allowing vectice to compute more metadata about the training set. |
None
|
testing_dataframe |
DataFrame | None
|
A pandas dataframe allowing vectice to compute more metadata about the testing set. |
None
|
validation_dataframe |
DataFrame | None
|
A pandas dataframe allowing vectice to compute more metadata about the validation set. |
None
|
Source code in src/vectice/models/dataset.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
origin
staticmethod
¶
origin(resource, name=None, dataframe=None)
Create an origin dataset.
Examples:
from vectice import Dataset, FileResource
dataset = Dataset.origin(
name="my origin dataset",
resource=FileResource(path="origin_dataset.csv"),
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resource |
Resource
|
The resource for the origin dataset. |
required |
name |
str | None
|
The name of the dataset. |
None
|
dataframe |
DataFrame | None
|
A pandas dataframe allowing vectice to compute more metadata about this dataset. |
None
|
Source code in src/vectice/models/dataset.py
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 |
|