anml.data package¶
Submodules¶
Data Specifications¶
Gives data specifications that are used in
Data.
A Data class can be subclassed
for use in applications that have other standard columns outside
of the three default
Data Management¶
Data is managed and processed using Data
with specifications provided through one or more
instances of DataSpecs.
- class Data(data_specs=None, param_set=None)[source]¶
Bases:
objectA data manager that takes data as inputs along with data specs and transforms into primitive types for use in the optimization.
- Parameters
data_specs (
Union[DataSpecs,List[DataSpecs],None]) – A data specification object, or list of data specification objects that indicate what the columns of a data frame represent.param_set (
Union[ParameterSet,List[ParameterSet],None]) – A parameter set that has covariate specifications, or list of these sets.
- data¶
A dictionary of numpy ndarrays keyed by the column attribute in _data_specs, extracted from the data frame after doing self.process_data(). If _data_specs has multiple elements, then the values will be a list of numpy ndarrays, in the order of _data_specs.
- covariates¶
- property data_spec_col_attributes¶
- property multi_param_set¶
- property multi_spec¶
- process_data(df)[source]¶
Process a data frame and attach to this instance with existing data specs.
- Parameters
df (
DataFrame) – A pandas.DataFrame with all of the information that the existing data specifications needs.
- exception DataTypeError[source]¶
Bases:
anml.data.data.DataErrorError raised when the data type is not understood.
- exception EmptySpecsError[source]¶
Bases:
anml.data.data.DataErrorError raise when an operation can’t be performed because there are no specifications associated with the Data instance.