artifact
Artifact implementation for MLTE report.
Report
Bases: Artifact
The report artifact contains the results of MLTE model evaluation.
Source code in mlte/report/artifact.py
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 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
comments = comments
instance-attribute
A collection of comments for the report.
negotiation_card_model = negotiation_card_model if negotiation_card_model else typing.cast(NegotiationCardModel, NegotiationCard.load(negotiation_card_id).to_model().body)
instance-attribute
The Negotiation Card with the requirements.
test_results_model = test_results_model if test_results_model else typing.cast(TestResultsModel, TestResults.load(test_results_id).to_model().body)
instance-attribute
A summary of model performance evaluation.
test_suite_model = test_suite_model if test_suite_model else typing.cast(TestSuiteModel, TestSuite.load(test_suite_id).to_model().body)
instance-attribute
The test suite used to generate these results.
type = ArtifactType.REPORT
class-attribute
instance-attribute
Class attribute indicating type.
__init__(identifier=None, negotiation_card_id=NegotiationCard.build_full_id(), negotiation_card_model=None, test_suite_id=TestSuite.build_full_id(), test_suite_model=None, test_results_id=TestResults.build_full_id(), test_results_model=None, comments=[])
Creates a Report.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
Optional[str]
|
The Report id (default value used if not provided). |
None
|
negotiation_card_id
|
str
|
The id of the negotiation card to use (defaults to default card id). |
build_full_id()
|
negotiation_card_model
|
Optional[NegotiationCardModel]
|
A NegotiationCardModel object; if None, NegotiationCard from the provided id will be loaded. |
None
|
test_suite_id
|
str
|
The id of the test suite to use (defaults to default suite id). |
build_full_id()
|
test_suite_model
|
Optional[TestSuiteModel]
|
A TestSuiteModel object; if None, TestSuite from the provided id will be loaded. |
None
|
test_results_id
|
str
|
The id of the test results to use (defaults to default results id). |
build_full_id()
|
test_results_model
|
Optional[TestResultsModel]
|
A TestResultsModel object; if None, TestResults from the provided id will be loaded. |
None
|
comments
|
List[CommentDescriptor]
|
Optional comments to add. |
[]
|
Source code in mlte/report/artifact.py
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 | |
from_model(model)
classmethod
Convert a report model to its corresponding artifact.
Source code in mlte/report/artifact.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
load(identifier=None)
classmethod
Load a Report from the configured global session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
Optional[str]
|
The identifier for the artifact. If None, the default id is used. |
None
|
Source code in mlte/report/artifact.py
127 128 129 130 131 132 133 134 135 | |
pre_save_hook(context, store)
Override Artifact.pre_save_hook(). Assigns time-stamped id to report, to ensure all have different ids.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
Context
|
The context in which to save the artifact |
required |
store
|
ArtifactStore
|
The store in which to save the artifact |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
On broken invariant |
Source code in mlte/report/artifact.py
138 139 140 141 142 143 144 145 | |
to_model()
Convert a report artifact to its corresponding model.
Source code in mlte/report/artifact.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |