Skip to content

model

Model implementation for negotiation card artifact.

DataDescriptor

Bases: BaseModel

Describes a dataset used in model development.

Source code in mlte/negotiation/model.py
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
class DataDescriptor(BaseModel):
    """Describes a dataset used in model development."""

    description: Optional[str] = None
    """A description of the dataset."""

    purpose: Optional[str] = None
    """A description of the purpose of the dataset."""

    source: Optional[str] = None
    """A description of the data source."""

    classification: str = ""
    """A description of the data classification level. Selected from classification custom list."""

    access: Optional[str] = None
    """A description of the manner in which this data is accessed."""

    labeling_method: Optional[str] = None
    """A description of how the data was labeled."""

    labels: list[LabelDescriptor] = []
    """A description of the labels that appear in the dataset."""

    fields: list[FieldDescriptor] = []
    """A description of the dataset schema."""

    rights: Optional[str] = None
    """A description of the ways in which the data can / cannot be used."""

    policies: Optional[str] = None
    """A description of the policies that govern use of this data."""

access = None class-attribute instance-attribute

A description of the manner in which this data is accessed.

classification = '' class-attribute instance-attribute

A description of the data classification level. Selected from classification custom list.

description = None class-attribute instance-attribute

A description of the dataset.

fields = [] class-attribute instance-attribute

A description of the dataset schema.

labeling_method = None class-attribute instance-attribute

A description of how the data was labeled.

labels = [] class-attribute instance-attribute

A description of the labels that appear in the dataset.

policies = None class-attribute instance-attribute

A description of the policies that govern use of this data.

purpose = None class-attribute instance-attribute

A description of the purpose of the dataset.

rights = None class-attribute instance-attribute

A description of the ways in which the data can / cannot be used.

source = None class-attribute instance-attribute

A description of the data source.

FieldDescriptor

Bases: BaseModel

Describes a dataset field.

Source code in mlte/negotiation/model.py
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
class FieldDescriptor(BaseModel):
    """Describes a dataset field."""

    name: Optional[str] = None
    """The name of the field."""

    description: Optional[str] = None
    """A description of the field."""

    type: Optional[str] = None
    """A description of the field type."""

    expected_values: Optional[str] = None
    """An example of expected values for the field."""

    missing_values: Optional[str] = None
    """An example of missing values for the field."""

    special_values: Optional[str] = None
    """An example of special values for the field."""

description = None class-attribute instance-attribute

A description of the field.

expected_values = None class-attribute instance-attribute

An example of expected values for the field.

missing_values = None class-attribute instance-attribute

An example of missing values for the field.

name = None class-attribute instance-attribute

The name of the field.

special_values = None class-attribute instance-attribute

An example of special values for the field.

type = None class-attribute instance-attribute

A description of the field type.

GoalDescriptor

Bases: BaseModel

A description of a system goal.

Source code in mlte/negotiation/model.py
26
27
28
29
30
31
32
33
class GoalDescriptor(BaseModel):
    """A description of a system goal."""

    description: Optional[str] = None
    """A description of the goal."""

    metrics: list[MetricDescriptor] = []
    """A collection of metrics related to the goal."""

description = None class-attribute instance-attribute

A description of the goal.

metrics = [] class-attribute instance-attribute

A collection of metrics related to the goal.

LabelDescriptor

Bases: BaseModel

Describes a dataset label.

Source code in mlte/negotiation/model.py
110
111
112
113
114
115
116
117
118
119
120
class LabelDescriptor(BaseModel):
    """Describes a dataset label."""

    name: Optional[str] = None
    """The name of the label."""

    description: Optional[str] = None
    """A description of the label."""

    percentage: Optional[float] = None
    """The relative frequency with which the label occurs in the dataset."""

description = None class-attribute instance-attribute

A description of the label.

name = None class-attribute instance-attribute

The name of the label.

percentage = None class-attribute instance-attribute

The relative frequency with which the label occurs in the dataset.

MetricDescriptor

Bases: BaseModel

A description of a metric that supports a system goal.

Source code in mlte/negotiation/model.py
16
17
18
19
20
21
22
23
class MetricDescriptor(BaseModel):
    """A description of a metric that supports a system goal."""

    description: Optional[str] = None
    """A description of the metric."""

    baseline: Optional[str] = None
    """A description of the metric baseline value."""

baseline = None class-attribute instance-attribute

A description of the metric baseline value.

description = None class-attribute instance-attribute

A description of the metric.

ModelDescriptor

Bases: BaseModel

A descriptor for the model.

Source code in mlte/negotiation/model.py
 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
class ModelDescriptor(BaseModel):
    """A descriptor for the model."""

    development_compute_resources: ModelResourcesDescriptor = (
        ModelResourcesDescriptor()
    )
    """A description of model development resource requirements."""

    deployment_platform: Optional[str] = None
    """A description of the platform used to deploy the model into the system."""

    capability_deployment_mechanism: Optional[str] = None
    """A description of how the model capabilities will be made available."""

    model_source: Optional[str] = None
    """A description of where the model came from."""

    input_specification: list[ModelIODescriptor] = []
    """The model input specification."""

    output_specification: list[ModelIODescriptor] = []
    """The model output specification."""

    production_compute_resources: ModelResourcesDescriptor = (
        ModelResourcesDescriptor()
    )
    """A description of model production resource requirements."""

capability_deployment_mechanism = None class-attribute instance-attribute

A description of how the model capabilities will be made available.

deployment_platform = None class-attribute instance-attribute

A description of the platform used to deploy the model into the system.

development_compute_resources = ModelResourcesDescriptor() class-attribute instance-attribute

A description of model development resource requirements.

input_specification = [] class-attribute instance-attribute

The model input specification.

model_source = None class-attribute instance-attribute

A description of where the model came from.

output_specification = [] class-attribute instance-attribute

The model output specification.

production_compute_resources = ModelResourcesDescriptor() class-attribute instance-attribute

A description of model production resource requirements.

ModelIODescriptor

Bases: BaseModel

A description of the model input or output specification.

Source code in mlte/negotiation/model.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
class ModelIODescriptor(BaseModel):
    """A description of the model input or output specification."""

    name: Optional[str] = None
    """A name for the input or output."""

    description: Optional[str] = None
    """A textual description of the input or output."""

    type: Optional[str] = None
    """A description of the type of data for this input or output."""

    expected_values: Optional[str] = None
    """Expected values for this input or output."""

description = None class-attribute instance-attribute

A textual description of the input or output.

expected_values = None class-attribute instance-attribute

Expected values for this input or output.

name = None class-attribute instance-attribute

A name for the input or output.

type = None class-attribute instance-attribute

A description of the type of data for this input or output.

ModelResourcesDescriptor

Bases: BaseModel

A descriptor for model resource requirements.

Source code in mlte/negotiation/model.py
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class ModelResourcesDescriptor(BaseModel):
    """A descriptor for model resource requirements."""

    cpu: Optional[str] = None
    """A description of model CPU requirements."""

    gpu: Optional[str] = None
    """A description of model GPU requirements."""

    gpu_memory: Optional[str] = None
    """A description of model GPU memory requirements."""

    main_memory: Optional[str] = None
    """A description of model memory (RAM) requirements."""

    storage: Optional[str] = None
    """A description of model storage requirements."""

cpu = None class-attribute instance-attribute

A description of model CPU requirements.

gpu = None class-attribute instance-attribute

A description of model GPU requirements.

gpu_memory = None class-attribute instance-attribute

A description of model GPU memory requirements.

main_memory = None class-attribute instance-attribute

A description of model memory (RAM) requirements.

storage = None class-attribute instance-attribute

A description of model storage requirements.

NegotiationCardModel

Bases: BaseModel

The model implementation for the NegotiationCard artifact.

Source code in mlte/negotiation/model.py
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
class NegotiationCardModel(BaseModel):
    """The model implementation for the NegotiationCard artifact."""

    artifact_type: Literal[ArtifactType.NEGOTIATION_CARD] = (
        ArtifactType.NEGOTIATION_CARD
    )
    """Union discriminator."""

    system: SystemDescriptor = SystemDescriptor()
    """The descriptor for the system in which the model is integrated."""

    data: list[DataDescriptor] = []
    """A collection of descriptors for relevant data."""

    model: ModelDescriptor = ModelDescriptor()
    """The descriptor for the model."""

    system_requirements: list[qas.QASDescriptor] = []
    """The descriptor of the system-level quality requirements."""

artifact_type = ArtifactType.NEGOTIATION_CARD class-attribute instance-attribute

Union discriminator.

data = [] class-attribute instance-attribute

A collection of descriptors for relevant data.

model = ModelDescriptor() class-attribute instance-attribute

The descriptor for the model.

system = SystemDescriptor() class-attribute instance-attribute

The descriptor for the system in which the model is integrated.

system_requirements = [] class-attribute instance-attribute

The descriptor of the system-level quality requirements.

SystemDescriptor

Bases: BaseModel

A description of the system context.

Source code in mlte/negotiation/model.py
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
class SystemDescriptor(BaseModel):
    """A description of the system context."""

    goals: list[GoalDescriptor] = []
    """A description of system goals."""

    problem_type: str = ""
    """A description of the machine learning problem type. Selected from problem types custom list."""

    task: Optional[str] = None
    """A description of the machine learning task."""

    usage_context: Optional[str] = None
    """A description of the usage context."""

    risks: list[str] = []
    """A description of risks associated with system failures."""

goals = [] class-attribute instance-attribute

A description of system goals.

problem_type = '' class-attribute instance-attribute

A description of the machine learning problem type. Selected from problem types custom list.

risks = [] class-attribute instance-attribute

A description of risks associated with system failures.

task = None class-attribute instance-attribute

A description of the machine learning task.

usage_context = None class-attribute instance-attribute

A description of the usage context.