Beispiel #1
0
 def test_quantitiative_analysis(self):
     mc = model_card.ModelCard()
     mc.model_details = {
         'name': 'quantitative analysis',
         'overview': 'This demonstrates a quantitative analysis graphic.',
         'owners': [{
             'name': 'bar',
             'contact': '*****@*****.**'
         }],
         'version': {
             'name': '0.4',
             'date': '2020-01-01',
             'diff': 'Updated dataset.',
         },
         'license': 'Apache 2.0',
         'references': ['https://my_model.xyz.com', 'https://example.com'],
         'citation': 'https://doi.org/foo/bar',
     }
     mc.model_parameters = model_card.ModelParameters(
         model_architecture='knn')
     mc.quantitative_analysis = model_card.QuantitativeAnalysis(
         graphics=model_card.Graphics(
             description='quantitative analysis graphic',
             collection=[{
                 'name': 'quantitative analysis graphic',
                 'image': 'I am an image beep boop'
             }]))
     self.assertRenderedTemplate(mc, ExpectedGraphic(quantitative=True))
Beispiel #2
0
 def test_train_and_eval_data(self):
     mc = model_card.ModelCard()
     mc.model_details = {
         'name': 'train and eval model',
         'owners': [{
             'name': 'bar',
             'contact': '*****@*****.**'
         }],
         'version': {
             'name': '0.3',
             'date': '2020-01-01',
             'diff': 'Updated dataset.',
         },
         'license': 'Apache 2.0',
         'references': ['https://my_model.xyz.com', 'https://example.com'],
         'citation': 'https://doi.org/foo/bar',
     }
     mc.model_parameters = model_card.ModelParameters(
         model_architecture='knn',
         data=model_card.Data(train=_TRAIN_DATA, eval=_EVAL_DATA))
     self.assertRenderedTemplate(mc, ExpectedGraphic())